DEV Community

Akash
Akash

Posted on

useReducer Hook

  • useReducer is a React Hook used to manage complex state logic.
  • Also it is used as alternative for useState,useReducer is used to make a cleaner and understandable code .

const [count, dispatch] = useReducer(reducer, initialState);

1.Count-current state
2.Dispatch-function

Top comments (0)