Are you new to React? Want to build your first React app but don’t know where to start?
Don’t worry! 😎 In this tutorial, I’ll show you step by step how to create your first React app using the popular tool Create React App.
By the end, you’ll have a running React project and understand the folder structure so you can start coding right away.
Step 1: Install Node.js
React uses Node.js and npm (Node Package Manager).
Download from 👉 https://nodejs.org/
After installing, check the versions:
node -v
npm -v
Step 2: Create the React App
Use npx
(comes with npm) to quickly generate your project:
Step 3: Start the Development Server
Go to your project folder:
Run:
Your new React app will open automatically at:
Step 4: Understand the Folder Structure
Here’s what’s inside:
Step 5: Edit Your First Component
Open src/App.js
and replace its content with:
Save the file – the browser will auto-refresh and show your message!
Step 6: Build for Production
When your app is ready to go live:
This creates an optimized build/
folder you can deploy to your server or services like GitHub Pages.
What’s Next?
You can now:
Add new componentsUse state and props
Connect APIs
Deploy online
React is fun and powerful – keep exploring! 🔥
👍 If you enjoyed this post, keep following the blog for more daily tips on JavaScript, React, and web development.