Element type is invalid after upgrading to 0.42.2
See original GitHub issueDescription
After upgrading from react-native 0.42.1 to 0.42.2 I get the following error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
I am using the following two libraries: react-native-router-flux and react-native-maps
The maps are not active and the error appears right after launch. I tried deactivating react-native-router-flux but the error persists.
I upgraded using the following commands:
$ react-native-git-upgrade $ react-native upgrade $ react-native link
After this was not working I also tried to remove node_modules, npm install and relink the libraries, but same behavior.
All went through fine, but as soon as the app starts I don’t see any content but the error. If I dismiss it the page remains white and empty.
Additional Information
- React Native version: 0.42.2
- Platform: both
- Operating System: macOS
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
My node version requires me to use import the following way:
import App from './app/index';
instead ofimport App from './app';
In addition to @chrisz100 's comment, this issue arises as RN adds an
app.json
file which confuses theimport
as its ambiguous between theapp
folder and theapp.json
file.