2 ms·
I've seen a couple of apps that have the same anti-pattern. They have a connected component that is basically a global container of all other components. They d
by fyfy18 7y ago
I've seen a couple of apps that have the same anti-pattern. They have a connected component that is basically a global container of all other components. They don't do anything sophisticated with shouldComponentUpdate, so whenever something changes all child components (i.e. basically the whole app) is rendered again.
On its own that isn't necessarily that bad, but combine that with form fields directly manipulating the Redux state (i.e. an action for every keypress) and it's easy to build an app that has poor performance.
- fourthark 7y agoSelecting only the needed data for each component should mitigate this, since react-redux automatically compares the selected data only. I will agree that it's too easy for components to watch too much of the state, but it's not necessarily wrong to have all the state in one tree.