Setup React Application using Npm
Here let's see what it takes to build your first react application.
ReactJS being a client-side library we require a package manager for automating the installing, upgrading and configuring packages.
One can execute reactjs code directly into Node.js, as React DOM has components specifically designed to reduce line of code, and making server-side rendering ease.
node -v npm -v /*both returns the version of same in your machine*/
Install React package using NPM
Starting off it's better to know some npm command basics.
npm init //creates manifest (package.json) file npm -i *package name* //creates specified package locally npm -i *package name* -g //creates specified package globally
These prove to be handy commands for further automation purposes through CLI.
For reactJS the command reads:
npx create-react-app *nameofyourapplication
Being a larger package takes time to install all dependencies to your machine, end of installation creates the file in the space specified in commandline.
Now open the file in your favorite code editor, in the integrated command line start the server using:
npm start //provides the localhost address and a system address to live output
Whoo hoo you've created a react application
Hope you all liked this post.
Share your thoughts in comments below and let me know any impression for this post.