React Native app fails to resolve components.
I am trying to import & render Test.jsx
inside of App.js
.
I get the following error-<
I am using react-native 0.59
and metro-react-native-babel-preset": "^0.53.0",
.
The ./rn-cli.config.js
file no longer works in the IOS release build. RN 0.59 requires a config file called metro.config.js in the root level. I have to use it to enable JSX support instead of rn-cli.config.js
. Check out the documentation for the config file: https://facebook.github.io/metro/docs/en/configuration.html
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
resolver: {
sourceExts: ['jsx','js', 'json', 'ts', 'tsx']
}
};