Reputation: 8034
When running my app I get into an error while the babel compiler is processing the JSX. It could be due to misconfiguration in the .babelrc
. Here is the error:
undefined is not an object (evaluating '_react.React.createElement')
transform-react-jsx
plugin for babel doesn't solve the problemindex.js:
renderLoadingView() {
return (
<View style={styles.container}> // Failing on index.js:217
<Text>
Loading the app...
</Text>
</View>
);
}
.babelrc:
{
"presets": ["react-native-stage-0"]
}
Upvotes: 0
Views: 360
Reputation: 11921
You have to import React if you use JSX, so you need to write
import React from 'react';
at the top of your file.
Upvotes: 1