title: Access variable made in componentDidMount
body: <p>I have a variable that I'm creating in <code>componentDidMount()</code> and I'd like it to be available in <code>componentDidUpdate()</code>. Any thoughts? Code looks like this:</p>
  
  <pre><code>class Example extends Component {
    componentDidMount() {
      const myVariable = 'this thing';
    }
  
    componentDidUpdate() {
      // I'd like my variable to be accessible here
      console.log(myVariable);
    }
  
    render() {...}
  }
  </code></pre>