DEV Community

loading...

Discussion on: Managing state with React Context

Collapse
jdnichollsc profile image
Juan David Nicholls Cardona

I recommend:

  • Use "useReducer" instead of "useState" for complex state logic like this
  • Use memoization to avoid re-renders
  • Use hooks to access to this state easier (good for testing)

Example: dev.to/ankitjena/ciao-redux-using-...

Thanks for sharing! <3

Collapse
olenadrugalya profile image
Olena Drugalya Author

Thank you for your recommendations!