title: setState/use State in external function react
body: <p>Considering this pseudocode:</p>
  
  <p><code>component.js</code></p>
  
  <pre><code>...
  import {someFunc} from "./common_functions.js"
  
  export default class MyComp extends Component {
      constructor(props) {
          super(props);
  
      this.someFunc = someFunc.bind(this);
  
      this.state = {...};
      }
  
      _anotherFunc = () = &gt; {
          ....
          this.someFunc();
      }
  
      render() {
          ...
      }
  }
  </code></pre>
  
  <p><code>common_functions.js</code></p>
  
  <pre><code>export function someFunc() {
      if(this.state.whatever) {...}
      this.setState{...}
  }
  </code></pre>
  
  <p>How would I bind the function <code>someFunc()</code> to the context of the <code>Component</code>? I use it in various Components, so it makes sense to collect them in one file. Right now, I get the error "Cannot read whatever of undefined". The context of <code>this</code> is unknown...</p>