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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
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