Skip to content

mosesgameli/react-context-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Context Example

This application demonstrates how to use React Context API hooks.

In this example, we provide 2 contexts. One for changing the theme and one for showing a list of books. You can find them defined in the contexts folder. You can take the book context to mean the single source of truth for providing list of books.

Getting started

  • clone this repository
  • run npm install to get the node modules
  • and then npm start to run the development server

Note that React version used is 16.8, if you find problems installing dependencies with Node 14+, it is advisable to create a new React app and then duplicate the code.

About

A demonstration of React context using hooks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published