An initialization argument is the second argument passed to useReducer. When an initialization function is supplied as the third argument, React passes this value to that function to compute the reducer’s initial state. section 3.3
Initializing a WeekPicker
A date-based WeekPicker can derive its initial state from an initialization argument: const [state, dispatch] = useReducer(reducer, initArgument, initFunction); On the first call, state is the initialization function’s return value; later calls use the current reducer state. section 3.3 section 3.5
Figure 3.6 The initialization function for useReducer uses the initialization argument to generate the reducer’s initial state.
Trace how the initialization function transforms the initialization argument into the reducer’s initial state. section 3.3
