Developing React with Poi is as easy as adding the babel-preset-react-app
to a .babelrc and installing React. This lesson will walk you through that quick process and get your React app up-and-running.
Install:
npm i react react-dom babel-preset-react-app babel-plugin-react-require
.babelrc:
{ "presets": [ "react-app" ], "plugins": [ "react-require" ] }
index.js:
// import React from 'react'; // NO NEED because babel-plugin-react-require import {render} from 'react-dom'; render(<h1>React</h1>, document.getElementById("app"))
Run:
poi