You can use useReducer
hook instead of redux if you want. But if you have a shared state between different components that are deep nested in different branches of DOM tree, implementation with useReducer
could be a little bit complicated. So using redux and saga does not contradict with hooks. Hooks just needed if prefer functional components over class components.
1 2 3 4 5 6 7 8 9 | function Centers(props) { useEffect(() => { props.getCenters(); }, []); return ( //render what you need here ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.