Redux
Dekket
Skal dekke
Burde sjekkes ut
Ekstern for react
Parent
Child
GrandChild
GrandChild
Child
Parent
Child
GrandChild
GrandChild
Child
Provider
Consumer
Consumer
Consumer
Consumer
From the table, you must be able to comprehend where the popular opinion Redux is for large projects & Context API for small ones come from.
Both are excellent tools for their own specific niche, Redux is overkill just to pass data from parent to child & Context API truly shines in this case. When you have a lot of dynamic data Redux got your back!
npm install @reduxjs/toolkit react-redux# Redux + Plain JS template
npx create-react-app my-app --template redux
# Redux + TypeScript template
npx create-react-app my-app --template redux-typescript
DEMO
Neste gang: Hooks: useReducer() / Repetisjon