Supplementary files for a blog post demonstrating the use of React Context to mitigate prop drilling.
- Clone this repo to your local machine.
- In a terminal:
cd
into the root of the project directory.npm i
npm start
- Play around with the forms, then inspect the code to see the differences between a prop-drilling approach vs a React Context approach.
- Check out
/src/NoContextComponent.jsx
to see a non-contextual, "prop drilling" approach. - Compare this with
/src/YesContextComponent.jsx
to see a context-based approach to prevent prop drilling.
- Check out