React preset

Strip flow types and transform JSX into createElement calls.

This preset includes the following plugins:

Basic Setup (with the CLI)

For more info, check out the setup page on the cli and the usage docs. You can also check out the React Getting Started page

# install the cli and this preset
npm install --save-dev babel-cli babel-preset-react

# make a .babelrc (config file) with the preset
echo '{ "presets": ["react"] }' > .babelrc

# create a file to run on
echo '<h1>Hello, world!</h1>' > index.js

# view output
./node_modules/.bin/babel index.js


$ npm install --save-dev babel-preset-react


Add the following line to your .babelrc file:

  "presets": ["react"]