The simplest way to create a basic react app is to run npx create-react-app and boom your basic react app will be created but have you ever wondere...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
For those criticizing the article for not using create app and therefore being slower and less secure.
I think this article is ideal for beginners. It's overwhelming seeing files and how they fit together if you never used React before. And it's easy to forget something if it was generated for you.
I like the explanations going through the set up incrementally and also one will remember things better having actually typed them up or pasted them in a manually created file.
I also like the use of webpack so if you know webpack this is familiar instead of using create React app in script commands.
And when you need to make your second React app to be faster or more secure, then one of always use the creact React app CLI to set up a new project.
Oh also this article uses the latest version of all the packages so security is taken care of there.
For my projects I like to have a template built around create React app output. Which already has docs and even CI to deploy to GitHub Pages.
Plus it has a bunch of sample components
MichaelCurrin / react-quickstart
Starter template for a React app - including docs, CI, and hosting ⚛ 📦
React Quickstart⚛️ 📦
Preview
How to create a new React app
Documentation
To install, run and deploy the app, see this project's docs:
To learn how to use this project and see how a React project works, see the Template notes section of the docs.
License
Released under MIT by @MichaelCurrin.
This project is based on the template from the React CLI. I have added my own docs, the deploy flow and made very minor changes to the app.
Oh and if you are curious on how to build and host with no Node, I have this.
MichaelCurrin / react-frontend-quickstart
Starter template using React on a website's frontend - without Node
React Frontend Quickstart⚛️ 📦
Preview
Documentation
License
Released under MIT by @MichaelCurrin.
I don't like create-react-app. It creates a bloated mess, installs stuff I never use, and fails to install other stuff I always use.
I'm actually using this tutorial to build a template I'm going to push to a private npm repository. It'll save me quite a bit of time once I have everything set up.
Thanks for the appreciation and explaining the things really nicely ..!!
Nice article. Would love to see creating react app with vite.
Thanks for the appreciation . Will surely write a post on creating react app with vite .
If you are gonna write something on Vite, please also include information on how to make a PWA in Vite and deploy it. I've tried making it, but it doesn't work in deployment
I will make sure to include your point on the article with vite ..!!
Thanks for reading the article and sharing your views ..!
Great! I would also recommend checking out Vite for React apps! It's very very much faster than Webpack!
I will explore more on vite and will bring articles on that too.
Thanks for reading the article and sharing your views ..!
I really like webpack, and your how-to is nicely focused on the minimal you need. Thanks for that
But to build a very simple SPA with react, I normally use parcel.
Thanks for the appreciation . Will also try to explore more on parcel too .
I like the article, very clean and to the point. Lean plugins and setup. Although I am wondering will this support HMR (hot module replacement or Fast refresh) with this configuration? Cheers. If not, can you share how to add that functionality. ^_^
As for now this doesn't support HMR + Fast Refresh but you can enable that in webpack with some configurations .
You can check this article to enable HMR + Fast Refresh in webpack : dev.to/workingeeks/speeding-up-you...
Thanks for reading the article and sharing your views ..!
Great tutorial, it gives us somewhat understanding how react works under the hood, but don't you think for beginners parcel.js would be a better way to start instead of webpack because parcel is way more easy to understand than webpack.
hola buen día Agradezco el articulo esta genial. Actualmente tengo dos proyectos uno creado desde cero utilizando webpack y el otro con create-react-app, que ventajas existe al realizar todo desde adicional al aprendizaje?
CRA is faster and easier for sure but I still prefer to scaffold my apps manually.
I've worked with devs who had absolutely no clue what to do when hit with babel or webpack issues, because CRA hides all of that detail away.
I feel like a basic understanding of build tools is pretty important for a frontend developer. If you don't at the very least roughly understand what's going on under the hood then you're basically just working with magic...
Using
npx create-react-app
is also best practice, because it is kept up-to-date and will include the latest security patches etcIts the best practice to use npx create-react-app as it makes this long process much more easier and well as keeps the project up to date ..!
Thanks for reading the article and sharing your views ..!
I am beginner in ReactJs.
I have some doubts
Can anyone help me.
Please.
Yes you can sure ask your doubts .
I need to create the below project in react, kindly check the below link, if possible please assit.
drive.google.com/file/d/1y3GusfPXD...
Worked 95%, but needed to change this line of package.json because it complained that mode was not set:
"start": "webpack serve --hot --open --mode development",
I'm a newbie. This is a amazing acticle thanks alot.
Thank you so much for the appreciation .
Nice
Thanks for the appreciation.
brilliant, got to explore how create-react-app is doing, what it is doing. Thank you.
Thanks for the appreciation and sharing your views ..!! : )
Great article! Thanks for spending the time to share it with us. It would be interesting to see this but with support for TypeScript.
Thanls for the appreciation . Will surely write an article with Typescript support .
Thank you. For those who want to know about what Webpack and Babel do in more depth and how they're useful, read this article: blog.jakoblind.no/babel-preset-env/
This is an excellent article. Thanks so much!
where is the linter?
As it was a very basic app i haven't added Linters , but you can always customize your project.
Cheers.!
Hi, firstly thank you for introducing amazing ideas and platforms with us. I really enjoy your work and the way you make it so interesting makes my focus and concentration intact.
awesome article thanks for your efforts.
I think you forget (webpack-dev-server), the app doesn't run without it
Thank you so much for the appreciation and correction . Will surely edit the post right away.
This is really helpful for understanding react better
Great article Riddhi! Love to see more articles from you!😃
Thanks for the appreciation . Will surely write more articles in future .
The whole point of writing the article was to know the background process as well as benefits of using npx create-react-app .
Thanks for reading the article and sharing your views ..!