title: how can i pass a useState hook defined with typescript down to another react component?
body: <h3>I am having some difficulties passing down a useState hook down from one component to another component using Typescript</h3>
  <p>Here is a very simple code that has only two files to show this problem:</p>
  <p><strong>the App component which is the entry point of the example</strong></p>
  <pre class="lang-js prettyprint-override"><code>import { useState } from 'react';
  import './App.css';
  import Header from './Components/Header';
  
  type personType = {
   name: String,
   language: String
  }
  
  const initialPerson ={
   name : 'james',
   language: 'english'
  } 
  
  function App() {
   const [ person, setPerson] = useState&lt;personType&gt;(initialPerson);
  
   return (
     &lt;div className=&quot;App&quot;&gt;
       &lt;Header setPerson={setPerson} person={person}/&gt;
     &lt;/div&gt;
   );
  }
  
  export default App;
  </code></pre>
  <p><strong>the Header component that receives the useState as props</strong></p>
  <pre class="lang-js prettyprint-override"><code>
  
  import { personType } from &quot;../../App&quot;
  
  const Header = ({person, setPerson}:{person: personType, setPerson:any}) =&gt; {
  
    const handleTranslate = () =&gt; {
      setPerson({name:'john', language:'french'})
    }
    return(
      &lt;div&gt;
        &lt;h1&gt;TYPESCRIPT TEST&lt;/h1&gt;
        &lt;button onClick={handleTranslate}&gt;clickMe&lt;/button&gt;
        {person.name}
        {person.language}
      &lt;/div&gt;
    )
  }
  
  export default Header
  </code></pre>
  <p>Now i am having trouble redefining the useState function 'setPerson' i am leaving it to :any for now because i can't seem to be able to find the right syntax in the there for the function argument.</p>
  <p>i have tried :</p>
  <pre class="lang-js prettyprint-override"><code> setPerson:(personType)=&gt; personType
  </code></pre>
  <p>the return type is fine, it is the argument that i cannot find the syntax for...</p>
  <pre><code></code></pre>