After creating a project with create-react-app
After running npm run eject to expose the configuration
Starting the project gives an error:
React is not defined
JSX runtime webpack configuration will be removed during eject
So you need to add the configuration back in package.json
// package.json
"babel": {
"presets": [
[
"react-app",
{
"runtime": "automatic"
}
]
]
}
暂无评论。