title: Typescript useState: SetState in Child with argument
body: <p>thx for any help.</p>
  <p>How can I pass down setState to a child component and use the c argument without a typescript error?</p>
  <p>Parent: Passing down setState</p>
  <pre><code>export interface State {
      value1: string;
      value2: string;
  }
  
  const Parent = () =&gt; {
      const [state, setState] = useState&lt;State&gt;({
          value1: &quot;test&quot;,
          value2: &quot;test&quot;,
      });
  
      return (
          &lt;React.Fragment&gt;
              &lt;Child setState={setState} /&gt;
          &lt;/React.Fragment&gt;
      );
  };
  
  export default Parent;
  </code></pre>
  <p>Child: use setState with c as argument, c is read underlined with a type error</p>
  <pre><code>type Props = {
      setState: Dispatch&lt;State&gt;;
  };
  
  const Child: React.FC&lt;Props&gt; = ({ setState }) =&gt; {
      return (
          &lt;React.Fragment&gt;
              &lt;button
                  onClick={() =&gt; {
                      //c is read underlined: Argument of type '(c: any) =&gt; any' is not assignable 
                      //to parameter of type 'State'.
                      //Type '(c: any) =&gt; any' is missing the following properties from type 
                      //'State': value1, value2
                      setState((c) =&gt; {
                          return {
                              ...c,
                              value2: &quot;HelloWorld&quot;,
                          };
                      });
                  }}
              /&gt;
          &lt;/React.Fragment&gt;
      );
  };
  
  export default Child;
  </code></pre>