title: Is it possible to modify the state of a react functional component in an external function(Another file)?
body: <p>I have a lot of methods in my functional component which i would like to place in separate files,these methods use the state of the functional component and it should be able to set the states.Example below:</p>
  <pre><code>export default functional_component(){
     const [state, setState] = React.useState({
          //state variables
  })
  }
  
  //another file.js
  const foo = () =&gt;{
            setState();
  
  }
  </code></pre>