Getting to Know the useReducer React Hook
Getting to Know the useReducer React Hook

Share this: 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? Well,... » read more

Managing State in React using Unstated-Next
Managing State in React using Unstated-Next

Share this: In a previous post, we saw how to manage state using Unstated. As you might recall, Unstated uses React’s built-in setState to allow you create components that can consume state by subscribing to a provider — like the React’s Context API. Well, we’re going to build off that last post by looking at... » read more