title: Why am I getting "useContext is not a function" or "context is not defined"?
body: <p>I am trying to use context in my stateless component. I updated my react to v16.8.0 and added useContext, however, I keep getting these two errors and don't know what else to do. Here is my code:</p>
  
  <pre><code>import React, { useState } from "react";
  import axios from "axios";
  import { LanguageContext } from "./languageContext";
  import { useContext } from "react";
  
  function StripeButton() {
    const context = useContext(LanguageContext);
    const stripe = Stripe("pk_live_5PjwBk9dSdW7htTKHQ3HKrTd");
  
    const [error, setError] = useState();
  
    const handleClick = () =&gt; {
      stripe
        .redirectToCheckout({
  ...
      });
    };
  
    return (
      &lt;div&gt;
        &lt;button
          id="UrgentCheckedButtonYES"
          className="btn-primary"
          onClick={handleClick}
        &gt;
          {this.context.main.name}
          &lt;br /&gt;
        &lt;/button&gt;
        &lt;div&gt;{error}&lt;/div&gt;
      &lt;/div&gt;
    );
  }
  
  export default StripeButton;
  StripeButton.contextType = LanguageContext;
  
  </code></pre>