title: Element type is invalid: expected a string or a class/function (for composite components) but got: undefined react
body: <p>I already searched for solutions and found many but they don't fit my problem.so I don't know how to solve this problem.</p>
  <p>this is full error:-</p>
  <blockquote>
  <p>Error: Element type is invalid: expected a string (for built-in
  components) or a class/function (for composite components) but got:
  undefined. You likely forgot to export your component from the file
  it's defined in, or you might have mixed up default and named imports.</p>
  <p>Check the render method of <code>WithAuthentication</code>.</p>
  </blockquote>
  <p>and this is <code>withAuthentication.js</code> file</p>
  <pre><code>import React from 'react'
  
  import AuthUserContext from './context'
  import { withFirebase } from '../Firebase'
  
  const withAuthentication = (Component) =&gt; {
      class WithAuthentication extends Component {
          constructor(props) {
              super(props)    
              this.state = {
                  authUser: null,
              }
          }
              componentDidMount() {
              this.listener = this.props.firebase.auth.onAuthStateChanged(
                  (authUser) =&gt; {
                      authUser
                          ? this.setState({ authUser })
                          : this.setState({ authUser: null })
                  }
              )
          }    
          componentWillUnmount() {
              this.listener()
          }
              render() {
              return (
                  &lt;AuthUserContext.Provider value={this.state.authUser}&gt;
                      &lt;Component {...this.props} /&gt;
                  &lt;/AuthUserContext.Provider&gt;
              )
          }
      }    
      return withFirebase(WithAuthentication)
  }    
  export default withAuthentication
  </code></pre>