How to Set Up a React Project
To initiate a React app, use the command:
$ npx create-react-app my-app
NPX is a package runner tool that comes with npm (Node Package Manager). It allows you to execute Node.js binaries without having to install them globally.
To install NPX, run the following command in your terminal: → npm install -g npx This installs NPX globally on your machine.
After installation, you can verify that NPX is installed by running: → npx --version This command should display the version number of NPX, confirming a successful installation.
Options for Creating a React App
The create-react-app command includes a starter-kit for React applications is pre-configured with tools like ES Lint, Prettier, Jest, etc. And it’s best suitable for tutorials, blog articles, and educational purposes.
On the other hand, the VITE Build Tool is a modern building tool with a React template, manual setup required for ESLint and others. It offers fast hot module replacement (HMR) and building, and it’s ideal for modern real-world applications.
Frameworks Around React
Two popular frameworks recommended by the React team:
Remix: A framework providing features essential for most apps and sites, including routing, data fetching, and HTML generation.
Next.js: Another recommended framework for building React apps and websites, with additional features like routing and server-side rendering.
I hope you enjoyed reading this, and I'm curious to hear if this tutorial helped you. Please let me know your thoughts below in the comments. Don't forget to subscribe to my newsletter to avoid missing my upcoming blog posts.