title: How to update an array within object with useReducer
body: <p>I am trying to update a state object. One of the items is a key whose value is an array of strings.</p>
  
  <p>I've been able to update the state, but it does not rerender. </p>
  
  <pre><code>const initialState = {
    showUpload: false,
    listItems: parentDirs,
    uploadPath: [],
    fileList: null
  };
  
  const reducer = (state, action) =&gt; {
    switch (action.type) {
      case "updateListItems":
        return { ...state, listItems: action.payload };
      case "updatePath":
        return {
          ...state,
          uploadPath: [...state.uploadPath, action.payload]
        };
      default:
        return state;
    }
  };
  
  const [state, dispatch] = useReducer(reducer, initialState);
  
  const pathFormat = state.uploadPath.join('/')
  
  return (
   &lt;p&gt;{pathFormat}&lt;/p&gt;
  )
  
  </code></pre>
  
  <p>The expected behavior would be that updating the array within the state object would trigger a rerender.</p>