title: Error: "domain option is required" in Auth0 create-react-app
body: <p>In writing a create-react-app application with authentication provided by Auth0, using a .env file, I am getting a "domain option is required" error. What's causing it and how do I fix it?</p>
  
  <p>(As seen in the code import statements, I'm using the react-use-auth npm module.)</p>
  
  <p>Note: This answer to this question may be found in other SO questions, but they don't reference this error. Hopefully this question helps people with this error find the solution faster. I'm posting the solution I found, but if this error has other causes it'd be great to document those, too.</p>
  
  <p><strong>index.js</strong> file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import { withRouter } from "react-router-dom";
  import { AuthProvider } from "react-use-auth";
  import App from './App';
  
  ReactDOM.render(
    &lt;React.StrictMode&gt;
    &lt;AuthProvider
      navigate={props.history.push}
      auth0_domain={process.env.REACT_APP_AUTH0_DOMAIN}
      auth0_client_id={process.env.REACT_APP_AUTH0_CLIENT_ID}&gt;
      &lt;App /&gt;
      &lt;/AuthProvider&gt;
    &lt;/React.StrictMode&gt;,
    document.getElementById('root')
  );
  
  export default withRouter(App);</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>.env</strong> file (in root directory created by create-react-app):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>REACT_APP_AUTH0_DOMAIN=[auth0_domain_name]
  REACT_APP_AUTH0_CLIENT_ID=[auth0_client_id]</code></pre>
  </div>
  </div>
  </p>