UseReducer:

Syntax -

useReducer(reducer-function , initial-state);

Syntax -

Const [state, dispatcher] =

useReducer(reducer-function , initial-state);

Explanation related to properties -

State: State contains data

dispatcher: dispatcher is a function. This function tells what can actually do to the reducer function.

This function tells what kind of action can be done in the reducer function.

Syntax :