1
votes

I am unable to bring up the react app. I changed import App to import {App}, in index.js. That does not work too

https://codesandbox.io/s/silly-cloud-6fj01?file=/src/App.js

Throws error: Invariant Violation 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, or you might have mixed up default and named imports.

2

2 Answers

1
votes

You're using react version 16.2.0, but StrictMode was introduced in 16.3. Upgrade both react and react-dom to at least 16.3 and everything will start working.

0
votes

You have to Change React Version and do the React version 16.3.0 or above then it's working.

Here is Working Demo