React: npx create-React-app vs referencing . js

Asked

Viewed 41 times

0

What a difference when working with React, using the command npx create-react-app APP when simply creating a file html and reference libraries via script (.js)

1 answer

2


The difference is that the command does everything for you: creates the directories and files, installs packages, makes the initial configuration and delivers the project ready to start.

After a while creating the same files, including the same references and installing the same packages for each new project, you will want to use the command. ;)

If you want more details about the command, see this link.

  • So if I simply include the . JS manually, it will work as well?

  • Yes, but you will need to install the required packages and perform the necessary imports and settings before starting the project.

  • But for a simple Hello World too?

  • Luhhh, it depends. If you will not use all available React resources, it is not necessary. But if you’re going to do a simple Hello World without using the various features of React (such as routes, for example), why use React? To see how to add React to an existing project, see that link.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.