News for hackers. Stuff that matters.
Re:Ask HN: How do you manage state in your React application? by atis on Saturday February 09, 2019 @09:41AM (#19122481)
Pass the things returned from useReducer() hook (state object + dispatch function) down via context. Then useContext() in child components.
Re:Ask HN: How do you manage state in your React application? by mustafa-alfar on Tuesday February 12, 2019 @11:53AM (#19145149)
How can you implement that, the useReducer must be inside the hooks component, so how can I export the value returned from useReducer to pass it into createContext ?