DEV Community

loading...

Three questions when starting with React.js.

luciunknown profile image Luciano Cardoso Updated on ・1 min read

1 - Why Do I need to use npm, npm does not stand's for Node.js, why I need it to deal with npm in a javascript react.js front-end project?

Javascript is now I full featured programming language and like one there is some ways to manage the dependencies. Npm is the one of those ways. Is the same logic to:

  • Nuget and .net
  • Composer and PHP
  • Java and Maven

2 - In my early days as a web developer I put the cdn hosted scripts on bottom of my html body tag and had to create that scripts that I needed, how I do that in a react.js project ?

This is still the way that js will be placed on the html, but now react.js will be in charge to put deployment version script on html page.

3 - Why there is a development server and a deployment version on React Project ?

Modern javascript frameworks like compiled languages put in one side the code repository and assets and on the other side a folder or set of folders that will be the deployment version. In this folder called "build" will be all the files that js project needs to work and also a html that works as a page root.

1 - $: npm install react

2 - $: npm install create-react-app myProject

4 - Development Process

3 - $myProject: npm run-script build ( creates a deployment version on build folder of the project)

Discussion (0)

pic
Editor guide