I'm new to Web development and react, I'm trying to learn useReducer and I don't quite understand the difference between currentstate and initial state.
const [state,dispatch]= useReducer(reducer, state).
On reading blogs on useReducer I frequently come across the term currentstate(which is attributed to the returned state
) while the state that is defined with useReducer is called initial state. I understand what initial state means, but what does current state mean? Is it the state that is obtained after performing actions through reducers?
Also, what does it exactly mean when it is said that useReducer returns an array? Does it mean that useReducer function takes an initial value and returns a mutated value(upon performing some operation), or is it something else?