your recipe card header background

    React useReducer hook

    0

    2

    Jose Romero

    reacthookuseReducer•••
    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

    import { useReducer } from "react";
    
    const [state, dispatch] = useReducer(reducer, initialArg, init); 
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.