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

Bolt.new vs Claude Code: Which AI Tool Is Superior for Indie Developers?

Bolt.new vs Claude Code: Which AI Tool Is Superior for Indie Developers? As an indie developer, you often find yourself juggling multiple roles—coder, marketer, and sometimes even

Aug 22, 20264 min read
Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Lines of Code in Under 30 Minutes

How to Use GitHub Copilot to Write Your First 10 Lines of Code in Under 30 Minutes If you're a beginner trying to learn how to code, the prospect of writing your first lines of cod

Aug 22, 20264 min read
Ai Coding Tools

Why AI Coding Tools are Overrated: Debunking 5 Myths in 2026

Why AI Coding Tools are Overrated: Debunking 5 Myths in 2026 As a solo founder or indie hacker, you’ve probably heard all the buzz surrounding AI coding tools. They promise to writ

Aug 22, 20264 min read
Ai Coding Tools

How to Boost Your JavaScript Skills with AI Tools in 30 Days

How to Boost Your JavaScript Skills with AI Tools in 30 Days If you're like many indie hackers and solo founders, you know that improving your coding skills can significantly impac

Aug 22, 20264 min read
Ai Coding Tools

How to Use AI Tools to Boost Your Coding Efficiency in 30 Minutes

How to Use AI Tools to Boost Your Coding Efficiency in 30 Minutes As indie hackers and solo founders, we all know that time is our most precious resource. When you're juggling mult

Aug 22, 20265 min read
Ai Coding Tools

How to Use AI Coding Tools to Build a Simple Web App in 30 Minutes

How to Use AI Coding Tools to Build a Simple Web App in 30 Minutes If you’ve ever thought about building a web app but were daunted by the coding involved, you’re not alone. The go

Aug 22, 20265 min read