0

これはばかげた質問に聞こえるかもしれませんが、これは私に2回起こりました。以前は完全に機能していましたが、ファイルの名前を変更した後、エラーが発生しました

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.

これが私の構造です。

* 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';

CRNA & EXPO の最新バージョンを使用しています。関係ないことはわかっていますが、それでも。

4

1 に答える 1