This is a project to compare the usage of Redux and React Context for manage store between pages (routes).
npm i
npm start
- Create a file .env in the root path with the following content, before running
npm start
:
REACT_APP_STORE=<store_name>
store_name defines if the app will use redux or context provider.
Values:
- redux
- context
- Do not use
window.location.replace('')
for redirecting pages, usehistory('/page')
instead. Redirection withwindow.location.replace('url')
refreshes the application, consequently its store (redux and context) gets the default value.