How to allow react-native to enable support for JSX (extension) files

后端 未结 3 703
小鲜肉
小鲜肉 2021-02-13 02:03

React Native app fails to resolve components.

I am trying to import & render Test.jsx inside of App.js.

I get the following error-<

3条回答
  •  清歌不尽
    2021-02-13 02:34

    It seems that the config schema was changed in 0.57 version: #248

    Try this:

    // ./rn-cli.config.js
    module.exports = {
      resolver: {
        sourceExts: ['jsx', 'js'],
      },
    };
    

提交回复
热议问题