title: Can useReducer work with an array for state?
body: <p>I've implemented a fairly simple means to add undo to <code>useReducer</code> with the following:</p>
  
  <pre><code>export const stateMiddleware = reducerFunc =&gt; {
    return function(state = { history: [] }, action) {
      return {
        history:
          action.type === UNDO
            ? drop(state.history) // lodash drop
            : [reducerFunc(state.history[0], action), ...state.history],
      }
    }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>const [state, dispatch] = useReducer(stateMiddleware(reducer), { history: [initialState] })
  </code></pre>
  
  <p>The <code>state</code> variable consists of the entire history so present state will have to be extracted from the first element.</p>
  
  <p>I'm wondering whether <code>useReducer</code> will accept an array for the <code>state</code> parameter (and also welcome to comments on my approach - it avoids using what seem to be hefty packages to do something similar)</p>