title: How to access the `context` for new react context API
body: <p>I'm trying to migrate to new version of React(16.3.2) and ran into a problem with getting access to <code>context</code> in new context API.</p>
  
  <p>I have a Provider component </p>
  
  <p><code>Provide.js</code></p>
  
  <pre><code>export const Context = React.createContext();
  
  export default class Provider extends Component {
  constructor(props) {
      super(props);
  
      this.state = {
        selection: new Selection({
          defaultSelection: props.defaultSelection,
          onChange: props.onChange,
        }),
      };
    }
  }
  
  render() {
      const { children } = this.props;
  
      return (
        &lt;Context.Provider value={this.state}&gt;
          {children}
        &lt;/Context.Provider&gt;
      );
    }
  </code></pre>
  
  <p>And in the <code>Consumer</code> component I can get acces to context in <code>render</code> method.</p>
  
  <pre><code>import { Context } from '../Provider';
  
  export default class Consumer extends Component {
    constructor(props, context) {
      super(props, context);
  
     // `this.context` is empty Object
      if (this.context.selection) {
        context.selection.register(props.tabFor);
      }
  
      this.handleClick = this.handleClick.bind(this);
    }
  
    componentDidMount() {
      // `this.context` is empty Object
      if (this.context.selection) {
        this.context.selection.subscribe(this.update);
      }
    }
  
    handleClick(event) {
      // `this.context` is undefined
      if (this.context.selection) {
        this.context.selection.select(this.props.tabFor);
      }
  
      if (this.props.onClick) {
        this.props.onClick(event);
      }
    }
  
    render() {
      return (
        &lt;Context.Consumer&gt;
          //context from `Provider`
          {(selection) =&gt; {
            return (&lt;button
              default={selection.defaultSelection}
              onChange={selection.onChange}
            &gt;
              {children}
            &lt;/button&gt;);
          }}
        &lt;/Context.Consumer&gt;
      );
    }
  }
  </code></pre>
  
  <p>But how to get access to conext in component methods or in the <code>constructor</code> like in old API from <code>this.context</code>?</p>