title: Cannot read property 'state' of undefined in react-native context api?
body: <p>I'm trying to context api in my ract-native app. But i'm getting this error.
  <strong>TypeError: TypeError: Cannot read property 'number' of undefined.</strong> What is wrong my code?</p>
  
  <p><strong>appContext.js</strong></p>
  
  <pre><code>import React from 'react';
  
  export const AppContext = React.createContext();
  
  class AppProvider extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              number: 10,
          };
      }
  
      render() {
          return 
          (
              &lt;AppContext.Provider value={this.state}&gt;
                  {this.props.children}
              &lt;/AppContext.Provider&gt;
          )
      }
  }
  
  export default AppProvider;
  </code></pre>
  
  <p><strong>homeScreen.js</strong></p>
  
  <pre><code>import { AppContext } from './appContext';
  &lt;AppContext.Consumer&gt;
      {(context) =&gt; context.number}
  &lt;/AppContext.Consumer&gt;
  </code></pre>