...

/

Using Astro with Your Favourite Framework

Using Astro with Your Favourite Framework

Learn how to combine Astro with different frameworks.

While this course focuses on using Astro exclusively, it’s important to understand how to integrate a third-party framework with Astro. In this lesson, we’ll take a quick look at adding React as an integration and using it within an Astro project.

Add React as an integration

The first step is to add React as an integration. To do this, run the application below, then execute the following command inside the terminal to install React as an integration:

Press + to interact
npx astro add react
export const Toggle = () => {
    return <h1>Hello from React 👋</h1>
}
Astro using React

Once we execute the command, Astro will prompt us to install the required dependencies. Press “Y” to accept the changes. It’ll ...