Getting to Know the useReducer React Hook

added by JavaScript Kicks
6/26/2019 2:40:41 PM

391 Views

useReducer is one of a handful of React hooks that shipped in React 16.7.0. It accepts a reducer function with the application initial state, returns the current application state, then dispatches a function. Here is an example of how it is used; const [state, dispatch] = useReducer(reducer, initialState); What's the good for?


0 comments