I try to implement a customReducer to manage my own custom state in React-Admin. I have looked through the documentation. I can see where to register the reducer in the <Admin>
, but I don't see where to really dispatch the reducer to store the state.
I also wish to know how to retrieve my state from the Redux store. What dataProvider is appropriate for this?
Please could someone share a code snippet to do this?
Thanks
First - reducers are not dispatched - probably you have meant actions.
After adding the customReducer
you interact with the store in the usual way any redux store is accessed: throught hooks if functional component useSelector()
useDispatch()
or through the connect
HOC in a class component.
Thanks Kia as usual. This is answerd