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 Most People Overrate GitHub Copilot

Why Most People Overrate GitHub Copilot As an indie hacker, I get it. The allure of AI tools like GitHub Copilot is hard to resist. Who wouldn't want to write code faster and with

Jun 30, 20264 min read
Ai Coding Tools

Best AI Coding Tools for Beginners: 5 Must-Haves in 2026

Best AI Coding Tools for Beginners: 5 MustHaves in 2026 If you're starting your coding journey in 2026, you might feel overwhelmed by the sheer number of tools available. The good

Jun 30, 20264 min read
Ai Coding Tools

The AI Coding Tool Showdown: GitHub Copilot vs Codeium

The AI Coding Tool Showdown: GitHub Copilot vs Codeium (2026) As an indie hacker or a solo founder, you know that coding can be a time sink—especially when you’re juggling multiple

Jun 30, 20263 min read
Ai Coding Tools

Cursor vs Claude Code: Which AI Coding Tool is Right for Developers in 2026?

Cursor vs Claude Code: Which AI Coding Tool is Right for Developers in 2026? As a developer, choosing the right AI coding tool can feel like navigating a maze. With the rapid advan

Jun 30, 20264 min read
Ai Coding Tools

Cursor vs. GitHub Copilot: Who Reigns Supreme in AI Coding 2026?

Cursor vs. GitHub Copilot: Who Reigns Supreme in AI Coding 2026? As a solo founder or indie hacker, the tools you use can make or break your productivity. With AI coding tools like

Jun 30, 20263 min read
Ai Coding Tools

How to Automate Code Debugging with AI in Under 30 Minutes

How to Automate Code Debugging with AI in Under 30 Minutes As a solo founder or indie hacker, you know that debugging can eat up your time faster than you can say "syntax error." I

Jun 30, 20264 min read