Use Reducer :
It is an alternate to useState .
It has workflow as redux(). Redux use to store state value in redux store .
UseReducer use to store state value to local const variable.
Reducer is nothing but functionality it will return the modified state value to the store based on user action dispatch .
Dispatch is actually the action that we try to dispatch to make change in the state variable based in reducer .
using
Reducer we can do any action we can trigger .
whenever we dispatch action it wil move to reduce depending the action reducer will modify iur state value then it will return.
const [state,dispatch] = useReducer(reduce, intial Argument,init);
One way :
const [state,dispatch] = useReducer(reduce, intial state);
Two way :
const [state,dispatch] = useReducer(reduce, count : intial count);