title: how to pass useState set state function to a child component in typescript?
body: <p>I recently started using typescript and I'm having trouble with passing a use state setter function,</p>
  <p>my parent component is is this :</p>
  <pre><code>const [word, setword] = useState('run')
  </code></pre>
  <p>and in the child im passing :</p>
  <pre><code>&lt;Child word={word} setword={setword}/&gt;
  </code></pre>
  <p>the child has this :</p>
  <pre><code>    interface Props {
        word: string
        
        setword: React.Dispatch&lt;React.SetStateAction&lt;string&gt;&gt;;
      }
      const VoicetoText: React.FC&lt;Props&gt; = (word, setword) =&gt; {
      return (
  {word}
  &lt;button onClick={()=&gt;setword('hey buddy')} &gt;&lt;button/&gt;
      )}
  </code></pre>
  <p>i keep getting an error :<a href="https://i.stack.imgur.com/0V2XG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0V2XG.png" alt="enter image description here" /></a></p>