To help understand hooks, you might wanna look up array destructuring (similar to object destructuring). In short - you can use whatever names you like when destructuring an array, so just use different names for your second useReducer hook!
const [state, dispatch] = useReducer(userDetailsReducer, initialState); const [likeState, likesDispatch] = useReducer(userLikesReducer, initialLikesState);
Thanks @antontsvil ! That helped me as well to understand that it is possible! great example!
Some comments have been hidden by the post's author - find out more
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To help understand hooks, you might wanna look up array destructuring (similar to object destructuring). In short - you can use whatever names you like when destructuring an array, so just use different names for your second useReducer hook!
Thanks @antontsvil ! That helped me as well to understand that it is possible! great example!