title: React this.setState not working with context API
body: <p>Currently I have this code from my AppContext.js file</p>
  
  <pre><code>import React, { Component, createContext } from 'react';
  
  export const AppContext = createContext();
  
  export class AppProvider extends Component {
  
  state = {
      test: '',
  };
  
  getEntries() {
      console.log('FIRED');
  
      this.setState({test: 'HELLO'});
  }
  
  render() {
      return (
        &lt;AppContext.Provider
            value={{
                ...this.state,
                getEntries: this.getEntries
            }}
        &gt;
            {this.props.children}
        &lt;/AppContext.Provider&gt;
      );
  }
  
  }
  </code></pre>
  
  <p>I'm calling the getEntries function and its displaying message from the console successfully but the this.setState is not working it says TypeError: this.setState is not a function</p>