I will add here: abstract here from your current state management tool. Create custom hooks that will provide data. It will be easy to change from for example React providers to Redux when needed just by replacing logic in custom hooks and not refactor every component.
I will add here: abstract here from your current state management tool. Create custom hooks that will provide data. It will be easy to change from for example React providers to Redux when needed just by replacing logic in custom hooks and not refactor every component.
Hi, @dikamilo, can provide an example? I would like to get a clear idea through it.
Thanks.
Great advice! It's clean to wrap hooks like useSelector, useEffect and useMemo in a custom hook and not in the component.