Skip to content

Supplementary files for a Hashnode article demonstrating the use of React Context to mitigate prop drilling.

Notifications You must be signed in to change notification settings

nitsudgo/blog-react-context-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-context-demo

Supplementary files for a blog post demonstrating the use of React Context to mitigate prop drilling.

Usage

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

About

Supplementary files for a Hashnode article demonstrating the use of React Context to mitigate prop drilling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published