title: React Context Typescript issue
body: <p>This is my AppContext.tsx</p>
  <pre><code>import React, { useState, createContext } from &quot;react&quot;;
  import { Iitem } from &quot;../utils/interfaces&quot;;
  interface AppContext {
    showModal: boolean;
    setShowModal: React.Dispatch&lt;React.SetStateAction&lt;boolean&gt;&gt;;
    cart: Array&lt;Iitem&gt;;
    setCart: React.Dispatch&lt;React.SetStateAction&lt;never[]&gt;&gt;;
    currentSelection: object | null;
    setCurrentSelection: React.Dispatch&lt;React.SetStateAction&lt;null&gt;&gt;;
  }
  export const AppContext = createContext&lt;AppContext&gt;({
    showModal: false,
    setShowModal: () =&gt; {},
    cart: [],
    setCart: () =&gt; {},
    currentSelection: null,
    setCurrentSelection: () =&gt; {},
  });
  
  export const AppState: React.FC = ({ children }) =&gt; {
    const [showModal, setShowModal] = useState(false);
    const [cart, setCart] = useState([]);
    const [currentSelection, setCurrentSelection] = useState(null);
    return (
      &lt;AppContext.Provider
        value={{
          showModal,
          setShowModal,
          cart,
          setCart,
          currentSelection,
          setCurrentSelection,
        }}
      &gt;
        {children}
      &lt;/AppContext.Provider&gt;
    );
  };
  </code></pre>
  <p>MyComponent.tsx</p>
  <pre><code>const MyComponent = () =&gt; {
   const {setCart} =  useContext(AppContext);
   const myFunc = () =&gt; {
     setCart((prevState) =&gt; [...prevState, newItem]);
   }
  }
  </code></pre>
  <p>When I try to call the <code>setCart</code> method, TypeScript errors out and if I hover over <code>(prevState)</code> it shows:</p>
  <pre><code>(parameter) prevState: never[]
  Argument of type '(prevState: never[]) =&gt; any[]' is not assignable to parameter of type 'SetStateAction&lt;never[]&gt;'.
    Type '(prevState: never[]) =&gt; any[]' is not assignable to type '(prevState: never[]) =&gt; never[]'.
      Type 'any[]' is not assignable to type 'never[]'.
        Type 'any' is not assignable to type 'never'.ts(2345)
  </code></pre>
  <p>How can I fix this?</p>