Setting up React from scratch VS create-react: UNDERSTANDING REACT

Hello,

So Ive finally started getting into react and Its looking like its going to be alot easier than I initially expected. This makes me very happy :upside_down_face: .

Ive come across videos that explain react and in these, videos they show how to set up a react project from scratch. Basically by installing Webpack modules and Babel - etc by hand. My question is, for those of you that use React; Is there a benefit to setting React up by hand over just executing a “npx create-react-app” terminal command ?

In the beginner videos Ive seen, they often start off by manually creating all of these modules and importing all these files to basically set up a React project. But then after, they show you how to use a create-react command to do everything they just demonstrated automatically. I would like to know why is this the case?

Is there a certain benefit to learning how to manually set up a react project form scratch? Im failing to understand why one would learn the process of manual setup in this tedious and error prone fashion.

Any help and advice would be greatly appreciated on this subject. Thank you. :pray:

There is nothing wrong with using npx create-react-app, but it just depends on what you plan on doing. You may not want want everything that comes along with the command, and taking a more manual approach will allow for you to not have things that are just wasting space, but if all you want to do is start creating react apps to create projects and enhance your skills I would go with npx create-react-app.

1 Like

Ok I see that makes sense :+1:

So is it mostly just about leaving things out? Im curious about if you change code within the packages could you get different results? For example could you (I don’t know) modify parts of the code in a way that it works with python or interprets certain functions differently?

I really don’t know as im just starting to learn, but my mind is blown open with how react makes Javascript work and Im curious about all the other cool things it could potentially do :sweat_smile:

I decided to delete my previous post because I’m not that will informed on the manipulation of packages.

1 Like

Hahaha I gotcha :sweat_smile: ,you deleted it right as I was re-reading it (sounded pretty correct to me but what would I know :thinking:) .

But yeah, learning about React has really gotten me curious about API’s and what they are and how they are formulated. Its really interesting stuff that I would really like to learn more about from a conceptual standpoint.

React has really blown open my pre-conceptions of what a coding language is. Cool stuff.

If you are really interested about what is going on under the hood:

Although I think it would be more useful to just read the docs.

1 Like

Ahh the docs! I keep forgetting to use the documentation as a resource until way later :sweat_smile: . Thanks for bringing that up!

Also thanks for the link I will check it out!

Thanks for your help and advice :+1:

1 Like

SIDENOTE: Do you think that React will help me understand arrow functions a bit more :face_with_monocle:? The arrow function is a concept that Ive been struggling with understanding, and I most often opt for using regular functions instead.

Ive noticed that React has more applications for arrow functions so Ive been trying to better understand them but they are confusing. Im hoping that using arrow functions more in react, ill get a better grasp on how they work… Any advise on that?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.