title: React, createContext default value problem with useState hook
body: <p>In my React application with typescript, I want to create a context for a component.  <code>createContext</code> shows an error if not providing defaultValue. one of the values I want to pass is <code>setFilters</code> which is a hook dispatcher. how should I provide a default value? </p>
  
  <p>I do not want it optional, to prevent <code>!</code> for invocation. </p>
  
  <pre><code>export interface ContextProps {
    filters: FiltersType;
    setFilters: React.Dispatch&lt;React.SetStateAction&lt;FiltersType&gt;&gt;;
  }
  
  export const MyContext = React.createContext&lt;ContextProps&gt;({
    filters: defaultFilters, // imported from constants holder
    setFilters: // &lt;---- What should be here 
  });
  
  const FiltersContext: React.FC&lt;IProps&gt; = (props: IProps) =&gt; {
    const [filters, setFilters] = React.useState&lt;FiltersType&gt;(defaultFilters);
  
    return &lt;MyContext.Provider value={{ filters, setFilters }}&gt;{props.children}&lt;/MyContext.Provider&gt;;
  };
  
  export default FiltersContext;
  </code></pre>