mthanh2209 / react-training

https://react-training-eight.vercel.app
0 stars 0 forks source link

Implement combining reducer with context #176 #177

Closed mthanh2209 closed 8 months ago

mthanh2209 commented 8 months ago
  1. How to combine a reducer with context?
  1. How to avoid passing state and dispatch through props?
    • By using context and a reducer, you can avoid passing state and dispatch through props from a parent component to deeply nested child components.
  2. How to keep context and state logic in a separate file?
    • To keep context and state logic in a separate file, create a file containing the context and reducer, and then import it into the components that need to use them.
    • This helps enhance reusability and maintainability of the codebase.
vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-training ❌ Failed (Inspect) Jan 15, 2024 8:07am
storybook ❌ Failed (Inspect) Jan 15, 2024 8:07am