Ai Coding Tools

How to Use GitHub Copilot to Write Your First React App in 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First React App in 2026

If you’re a solo founder or side project builder, the thought of writing your first React app can feel daunting. You might be juggling a million other tasks, and learning a new framework while trying to ship something feels like a mountain to climb. But what if I told you that you could leverage AI to help you get your app off the ground in just about two hours? Enter GitHub Copilot.

In this guide, I’ll walk you through how to use GitHub Copilot effectively to build a simple React app. We’ll cover everything from prerequisites to step-by-step instructions, and I’ll share some honest insights about what works, what doesn’t, and how much it costs.

Time Estimate and Prerequisites

Time Estimate: You can finish this in about 2 hours if you follow along closely.

Prerequisites:

  • Basic understanding of JavaScript and React concepts
  • A GitHub account (free)
  • Visual Studio Code (free)
  • GitHub Copilot subscription: $10/month or $100/year (as of August 2026)
  • Node.js installed on your machine

Step 1: Setting Up Your Environment

  1. Install Visual Studio Code: Download and install VS Code.
  2. Set Up GitHub Copilot: Go to the Extensions panel in VS Code, search for "GitHub Copilot," and install it. You’ll need to log in with your GitHub account.
  3. Create a New React App: Open your terminal and run:
    npx create-react-app my-first-app
    cd my-first-app
    code .
    

Expected Output: A new React app folder should open in VS Code.

Step 2: Building Your App with GitHub Copilot

2.1 Generating Components

  1. Create a New Component: In the src folder, create a new file called HelloWorld.js.
  2. Start Writing Code: Type a comment describing what you want Copilot to generate. For example:
    // Create a functional component that renders "Hello, World!"
    

Expected Output: Copilot should suggest a functional component. Accept the suggestion.

2.2 Adding State Management

  1. Use State Hook: In your HelloWorld.js, add a state hook:
    // Add a state variable to keep track of clicks
    

Expected Output: Copilot should suggest a state variable and a function to update it.

2.3 Rendering the Component

  1. Render Your Component: In App.js, import and render your HelloWorld component:
    // Import HelloWorld and render it in the App component
    

Expected Output: Your app should now display "Hello, World!" and an interactive button to track clicks.

Troubleshooting Common Issues

  • Copilot Not Suggesting Code: Ensure that you are logged into GitHub Copilot and that your subscription is active.
  • Unexpected Code Suggestions: Sometimes Copilot may suggest code that doesn't fit your needs. Don't hesitate to modify the suggestions or ask for something else by typing more specific comments.

What’s Next?

Once your basic app is up and running, you might want to dive deeper into React features, such as routing or API calls. You can also look into deploying your app on platforms like Vercel or Netlify.

Conclusion: Start Here

To recap, using GitHub Copilot can dramatically speed up your development process, especially for beginners. With just a couple of hours, you can have a working React app, tailored by AI. If you’re looking to build something simple but functional, start with the steps outlined above and don’t hesitate to explore more complex features once you’re comfortable.

What We Actually Use

While GitHub Copilot is our go-to for coding assistance, we also rely on:

  • React DevTools: For debugging and inspecting React components.
  • Postman: For testing API endpoints.
  • Vercel: For easy deployment.

If you’re serious about shipping your first React app, GitHub Copilot is a valuable tool to have in your arsenal.

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 Automate Your Development Workflow with AI in 3 Easy Steps

How to Automate Your Development Workflow with AI in 3 Easy Steps (2026) As indie hackers and solo founders, we often find ourselves buried under a mountain of repetitive tasks tha

Sep 3, 20264 min read
Ai Coding Tools

How to Boost Your Coding Velocity with AI in 30 Minutes

How to Boost Your Coding Velocity with AI in 30 Minutes As a solo founder or indie hacker, you know that time is your most precious resource. The idea of boosting your coding veloc

Sep 3, 20264 min read
Ai Coding Tools

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted As we dive into 2026, GitHub Copilot has become a staple in many developers' toolkits. However, despite its popularity,

Sep 3, 20263 min read
Ai Coding Tools

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours As indie hackers, we all know the struggle of trying to stay productive while juggling multiple projects. The prom

Sep 3, 20265 min read
Ai Coding Tools

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project?

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project? As a solo founder or indie hacker, choosing the right tools can be a makeorbreak decision for your project. With

Sep 3, 20263 min read
Ai Coding Tools

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths As a programmer, I’ve been there: staring at a blank screen, hoping for a burst of inspiration

Sep 3, 20264 min read