Ai Coding Tools

How to Build a Simple React App Using GitHub Copilot in 2 Hours

By BTW Team3 min read

How to Build a Simple React App Using GitHub Copilot in 2026

Building a React app can feel overwhelming, especially if you’re juggling multiple side projects or just starting out. The good news? GitHub Copilot is here to help you code faster and smarter. In this guide, I’ll show you how you can build a simple React app in about 2 hours using GitHub Copilot.

Prerequisites

Before we dive in, let’s make sure you have everything set up:

  • Node.js: Make sure you have Node.js installed (version 14 or higher). You can download it from nodejs.org.
  • GitHub Account: You’ll need a GitHub account to use GitHub Copilot.
  • Code Editor: I recommend using Visual Studio Code, as it has excellent integration with GitHub Copilot.

Step 1: Set Up Your Project

  1. Create a New Directory: Open your terminal and run:

    mkdir my-react-app
    cd my-react-app
    
  2. Initialize a New React App: Use Create React App to bootstrap your project:

    npx create-react-app .
    

    This will create a simple React app structure for you.

  3. Install GitHub Copilot: If you haven’t already, install the GitHub Copilot extension in Visual Studio Code. You can find it in the Extensions Marketplace.

Step 2: Start Coding with GitHub Copilot

Now that your project is set up, let’s start coding. Here’s how I typically leverage Copilot:

  1. Open a New Component File: Create a new file in the src directory called MyComponent.js.

  2. Get Started with Copilot: Start typing a comment or function name, and Copilot will suggest code. For example, type:

    // Create a functional component that displays a welcome message
    

    Copilot will auto-generate a component based on your comment. You can accept the suggestion by hitting Tab.

  3. Iterate and Improve: As you build out your component, keep using Copilot for repetitive tasks. If you need to add state or props, just type:

    // Add a state for user input
    

    Copilot will help you with the necessary hooks.

Step 3: Running Your App

Once you've added a few components and set up your app, you can run it:

npm start

Your app should now be live at http://localhost:3000, and you can see your progress in real-time.

Troubleshooting

Common Issues

  • Copilot Not Suggesting Code: Make sure you’re connected to the internet and that the extension is enabled in Visual Studio Code.
  • Errors in Your Code: If you encounter errors, double-check the suggestions Copilot provided. Sometimes, you’ll need to tweak the code to fit your needs.

What Could Go Wrong

  • Missing Dependencies: If you get errors about missing packages, make sure you’ve installed all necessary dependencies with npm install.
  • Performance Issues: If your app is slow, check for unnecessary re-renders or large assets.

What’s Next?

Once your basic app is up and running, consider adding more features:

  • Routing: Use React Router to navigate between different pages.
  • State Management: Implement Redux or Context API for more complex state management.
  • Deployment: Host your app on platforms like Vercel or Netlify for easy sharing.

Conclusion

Building a simple React app with GitHub Copilot can be an efficient way to kickstart your project. With the right setup and a bit of creativity, you can have a functional app ready in just 2 hours.

Start Here

If you’re new to React or coding in general, start by following the steps outlined above. Use GitHub Copilot to help you along the way, and don’t be afraid to experiment.

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

How to Build Your First AI Project in Just 3 Hours

How to Build Your First AI Project in Just 3 Hours If you’re a solo founder or indie hacker looking to dip your toes into the world of AI, you might be wondering where to start. Th

Jul 20, 20264 min read
Ai Coding Tools

Is GitHub Copilot Really Worth the $10/Month? Let's Find Out

Is GitHub Copilot Really Worth the $10/Month? Let's Find Out As a solo founder or indie hacker, every dollar counts. When it comes to tools that promise to make your life easier—li

Jul 20, 20264 min read
Ai Coding Tools

How to Deploy Your First AI-Powered App in 2 Hours

How to Deploy Your First AIPowered App in 2 Hours Deploying an AIpowered app can feel like a daunting task. If you're a solo founder or an indie hacker, the thought of spending wee

Jul 20, 20264 min read
Ai Coding Tools

How to Write Your First Code with AI Assistance in 2 Hours

How to Write Your First Code with AI Assistance in 2026 If you're a beginner looking to get into coding, the idea of writing your first piece of code can feel daunting. What if I t

Jul 20, 20264 min read
Ai Coding Tools

10 Mistakes First-Time Coders Make with AI Tools

10 Mistakes FirstTime Coders Make with AI Tools If you're a firsttime coder stepping into the world of AI tools in 2026, you're probably excited but also a bit overwhelmed. We've b

Jul 20, 20264 min read
Ai Coding Tools

How to Build Your First Chatbot Using AI in Just 30 Minutes

How to Build Your First Chatbot Using AI in Just 30 Minutes Building a chatbot can feel like an ambitious project, especially if you're not a coding wizard. But here’s the kicker:

Jul 20, 20264 min read