React-Native Invariant Violation: Element type is invalid

In my case instead of exporting like this:

export default App;

...I exported like following:

export {LoginForm};

It worked completely fine.


I had this error from doing my export in the following style with no default export specified. I did not specify a default because I was exporting multiple small components from one file.

export const  Modal  = (props) => (
    <div className="someClass">
    </div>        
  )

I was able to get it working by adding brackets to the import statement.

import {Modal} from '../components/Modal.js'

Expo expects you to export a component from /App.js. But right now you are only importing into /App.js. Expo is not receiving any component to render. You need to export the component you imported like this:

export default App;

On side note: Use a class component only if you must.