3 ms·
OP didn't want to use hooks, so I showed an example that doesn't require hooks. I'm aware some of the React community use hooks, some of us still use classes.
by chrisabrams 6y ago
OP didn't want to use hooks, so I showed an example that doesn't require hooks.
I'm aware some of the React community use hooks, some of us still use classes. Classes provide a better interface when dealing with state that is shared between parent and child. This is a write up much better than I can explain: https://react-redux.js.org/api/hooks#stale-props-and-zombie-children https://react-redux.js.org/api/hooks#stale-props-and-zombie-...