Now this might be sound silly question, but this happened to me twice. It was working before perfectly but after I renamed the file, it gives me 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.
Here's my structure.
* App.js
* src
- screens
- Main
- index.js
- Main.js
index.js
import Main from './Main';
export default Main;
Main.js
const Main = () => null;
export default Main;
App.js
import Main from './src/screens/Main/index';
I am using latest version of CRNA & EXPO. I know it has nothing to do with it, but still.