difference between preset-react and react in babel

Viewed 2982

I am creating a React project from scratch without create-react-app. But it worked fine on my mac but not on my other ubuntu laptop. Below is my previous .babelrc file content.

"presets": [
    "@babel/preset-react",
    "@babel/preset-env"
]

It works fine on my mac (npm version 6.12.0) but not on ubuntu(npm version 6.14.5) It shows error that can't compile src/index.js -> below line

ReactDOM.render(<App />, document.getElementById('root'));

So I changed .babelrc env file to

"presets": [
    "@babel/react",
    "@babel/env"
]

And it worked on both finally. But I am not sure exactly the difference between @babel/preset-react and @babel/react. If anyone knows exact difference between these two, please let me know. Thanks for your help!

1 Answers
Related