The quickest way to get started with react is to follow the official react tutorial.
Firstly you would want to make sure you have Node installed in your machine.
To download Node, go to: https://nodejs.org/en/download/
If you already have node installed, make sure it is updated to its latest version:
> npm install npm@latest -g
Next create the skeleton react app using create-react-app program
> npm install -g create-react-app
> create-react-app my-app
> cd my-app
> npm start
To work with React Projects, I use ATOM with added plugin Language-Babel package.
To Build React for Production use:
> npm run build
This will create a build folder and the index.html and its contents can be hosted in production.
To run it, you can install the serve program
> npm install -g serve
> serve -s build
Note:
create-react-app uses Webpack underneath it to bundle your code and all its dependencies, It also uses also uses Babel to Tranform next generation java script (llike es6) to browser compatible java scripts
No comments:
Post a Comment