4 ms·
The same is true in redux, every action calls every reducer, every connected component renders. Thats why with and without redux you need performance optimizati
by joshribakoff 4y ago
The same is true in redux, every action calls every reducer, every connected component renders. Thats why with and without redux you need performance optimizations like memoizing components and/or selectors
Not that with just react contexts, you can chose to split them up instead of or in addition to employing memoization
- yawnr 4y agoThat's not true though. Every connected component subscribed to a particular slice of state updates...not every connected component, e.g. `useSelector(appState => !!appState.someThing)` only causes a re-render of the subscribed component if the value of `!!appState.someThing` changes. Unless that's what you meant in the first place but your tone and talk of memoization seemed to imply otherwise.