Using reselect
Use Reselect in Redux connect(mapState) -- to avoid frequent re-render.
The bad way
In this above case every time otherData in the state changes both DataContainer and ResolutionContainer will be rendered even when the resolution in the state does not change. This is because the doubleRes function will always return a new resolution object with a new identity. If doubleRes is written with Reselect the issue goes away: Reselect memoizes the last result of the function and returns it when called until new arguments are passed to it.
The good way
Related links:
Last updated
Was this helpful?