babel change react to javascript
install babel
add plug ins to compile to javascript
here we need react and env to convert jsx to javascript
yarn global add babel-cli@6.24.1
npm install -g babel-cli
babel –help
sudo npm install -g babel-cli@6.24.1
yarn init == npm init
yarn add babel-preset-react@5.24.1 babel-preset-env@1.5.2
create folde src and file app.js with jsx
this file will be translated to app.js inside out app
babel src/app.js –out-file=scripts/app.js –presets=env,react –watch
Leave a Reply