When I going to run my react native app on my iPhone Expo this error displayed in red background area.
Invariant Violation: Element type is invalid: e
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'
i had same issue and i put
export default
before
class yourclassname extends Component
in App.js
In my case instead of exporting like this:
export default App;
...I exported like following:
export {LoginForm};
It worked completely fine.
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.