Hacker News new | ask | show | jobs
by dceddia 2237 days ago
The implication behind “we don’t use Redux, we use hooks” is that they’re using React’s Context API directly as a “store”. A component at the top level has some state, probably using the useReducer hook, that state is passed down using a Context Provider, and child components can access the data with useContext.

You can DIY a Redux imitation with hooks pretty easily but making it as performant as Redux is harder.

1 comments

Indeed. IIRC redux itself tried that in an earlier version but reverted to a custom update / forced render mechanism due to performance bottlenecks with Context.
Yep. References with the details on what we tried to do in v6, and how we rewrote things in v7:

- https://github.com/reduxjs/react-redux/issues/1177

- https://blog.isquaredsoftware.com/2018/11/react-redux-histor...