title: TypeError: Object(...) is not a function when exporting page
body: <p>I'm new with Reactjs and currently following this tutorial (<a href="https://www.robinwieruch.de/complete-firebase-authentication-react-tutorial/#react-firebase-protected-routes" rel="nofollow noreferrer">https://www.robinwieruch.de/complete-firebase-authentication-react-tutorial/#react-firebase-protected-routes</a>) about authentication with react and firebase, but at this point a got this strange error.</p>
  
  <pre><code>TypeError: Object(...) is not a function
  Module../src/containers/Autenticacao/Conta/index.jsx
  src/containers/Autenticacao/Conta/index.jsx:17
    14 | 
    15 | const condition = authUser =&gt; !!authUser;
    16 | 
  &gt; 17 | export default withAuthorization(condition)(AccountPage);
  </code></pre>
  
  <p>I'm not sure what's the reason because I got no error in the terminal, just acessing the page.</p>
  
  <p>Here's what the whole code looks like:    </p>
  
  <pre><code>import React from 'react';
  
  import { PasswordForgetForm } from '../PasswordForget';
  import PasswordChangeForm from '../PasswordChange';
  import { withAuthorization } from '../Session';
  
  const AccountPage = () =&gt; (
    &lt;div&gt;
      &lt;h1&gt;Account Page&lt;/h1&gt;
      &lt;PasswordForgetForm /&gt;
      &lt;PasswordChangeForm /&gt;
    &lt;/div&gt;
  );
  
  const condition = authUser =&gt; !!authUser;
  
  export default withAuthorization(condition)(AccountPage);
  </code></pre>
  
  <p>I thought it could be something wrong in the "withAuthorization" function, but I'm already using it to export another page.</p>
  
  <p>Here's the "withAuthorization" file for support:</p>
  
  <pre><code>import React from 'react';
  import { withRouter } from 'react-router-dom';
  import { compose } from 'recompose';
  import AuthUserContext from './context';
  import { withFirebase } from 'context';
  import * as ROUTES from 'routes/portfolio';
  
  const withAuthorization = condition =&gt; Component =&gt; {
    class WithAuthorization extends React.Component {
      componentDidMount() {
        this.listener = this.props.firebase.auth.onAuthStateChanged(
          authUser =&gt; {
            if (!condition(authUser)) {
              this.props.history.push(ROUTES.SIGN_IN);
            }
          },
        );
      }
  
      componentWillUnmount() {
        this.listener();
      }
  
      render() {
        return (
            &lt;AuthUserContext.Consumer&gt;
             {authUser =&gt;
               condition(authUser) ? &lt;Component {...this.props} /&gt; : null
             }
           &lt;/AuthUserContext.Consumer&gt;
        );
      }
    }
  
    return compose(
      withRouter,
      withFirebase,
    )(WithAuthorization);
  };
  
  export default withAuthorization;
  </code></pre>