title: Function components do not support contextType
body: <blockquote>
    <p>Function components do not support contextType.</p>
  </blockquote>
  
  <p>I encountered an issue when trying to add context to a React component that was wrapped with a React Router <code>withRouter(...)</code> function.</p>
  
  <pre><code>import React, { Component } from 'react'
  import UserContext from './UserContext'
  class Toolbar extends Component {
    render(){
      return (
        &lt;div&gt;username: this.context.username&lt;/div&gt;
      )
    }
  }
  Toolbar.contextType = UserContext
  export default withRouter(Toolbar)
  </code></pre>