Ai Coding Tools

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

By BTW Team3 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step tutorial on leveraging GitHub Copilot to build a simple React application in just 2 hours.

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.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read