title: React export React.createContext not defined
body: <p>I am trying to learn React Context and got stuck. Need help.</p>
  
  <p><strong>App.js</strong></p>
  
  <pre><code>import React from 'react';
  import Header from './components/Header';
  
  export const MyContext = React.createContext("Default");
  
  class App extends React.Component {
    render() {
      return (
        &lt;MyContext.Provider value="dark"&gt;
          &lt;Header /&gt;
        &lt;/MyContext.Provider&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p><strong>Header/index.js</strong></p>
  
  <pre><code>import React, { Component } from 'react'
  import { MyContext } from "./../../App";
  
  class Header extends Component {
      //static contextType = MyContext;
      render() {
          return (
              &lt;div&gt;
                  {this.context}
              &lt;/div&gt;
  
          )
      }
  }
  
  Header.contextType = MyContext;
  export default Header;
  </code></pre>
  
  <p>Got an error <strong>MyContext is not defined</strong>.
  It works when i move Header class to App.js</p>
  
  <p>What am i doing wrong? Tnx for your help</p>