Leveraging the Context API in React.js

christoffer noring
ITNEXT
Published in
1 min readMar 5, 2019

--

Follow me on Twitter, happy to take your suggestions on topics or improvements /Chris

The React Context exist so you don’t have to pass in data manually at every level. Context is about sharing data to many components

In this article we will learn about the following topics:

  • The context API, what it is and why use it
  • Building blocks, we will learn about the different building blocks using a Context and how they work together
  • In action demonstrations, we will look at several examples of creating a Context and we will ensure we learn about Dynamix contexts and how HOC, higher order components can help clean up our Context code

If you ever get lost following the code samples in the article, have a look at this demo containing all the code shown below:

this articl has been moved to https://softchris.github.io/pages/react-context.html

--

--