You pass a lazy initializer to useReducer to avoid recomputing initial state on every render. How many times is the `init` function invoked across the component's lifetime?
function init(initialCount) {
return { count: initialCount, history: [] };
}
function Counter({ initialCount }) {
const [state, dispatch] = useReducer(reducer, initialCount, init);
// ...
}