title: export function inside react component or access state in same file outside of component
body: <p>I have a function that needs to be exported from the file, but at the same time, I need to utilize react state to re-render when updated.</p>
  
  <p>It doesn't quite seem like it possible to export a function from inside of the class, so how can I update state from a function outside of the class?</p>
  
  <pre><code>import React, {Component} from 'react';
  
  export function functionName(){
  const filter = some filter;
    this.setState({
      filter: newFilter
    })
  }
  
  class ClassName extends Component{
    constructor(){
      super();
      this.state = {
        filter: {}
      }
    }
    render(){
      &lt;&gt;
      &lt;/&gt;
    }
  }
  </code></pre>