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

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for Beginners

10 Common Mistakes When Using AI Coding Tools for Beginners As a beginner in coding, diving into AI coding tools can feel like a doubleedged sword. On one hand, these tools promise

Oct 8, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back As a solo founder or indie hacker, you might be considering leveraging AI coding tools to boost your produc

Oct 7, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning As a beginner in coding, diving into the world of AI coding tools can feel like stepping into a futuristi

Oct 6, 20263 min read
Ai Coding Tools

10 AI Coding Tools Beginners Overlook in 2026

10 AI Coding Tools Beginners Overlook in 2026 As a beginner in coding, diving into the vast ocean of AI tools can feel overwhelming. While flashy tools often grab the spotlight, ma

Oct 6, 20265 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Beginners Believe

5 Common Misconceptions About AI Coding Tools That Beginners Believe As a solo founder or indie hacker, diving into the world of AI coding tools can feel overwhelming, especially i

Oct 5, 20263 min read