import { useReducer } from "react";
      
      const [state, dispatch] = useReducer(reducer, initialArg, init); 
      Javascript language logo
      your recipe card header background

      React useReducer hook

      react
      hook
      useReducer
      ...
      React JavaScript Recipes

      An alternative to useState. Accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method. (If you’re familiar with Redux, you already know how this works.)

      Library: react

      Shortcut: react.hook.reducer.use

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.