# Use React component in Astro

> Learn how to use a React component inside Astro: run npx astro add react, import the component, and add client:load to make it interactive in the browser.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2023-10-30 | Topics: [Astro](https://flaviocopes.com/tags/astro/), [React](https://flaviocopes.com/tags/react/) | Canonical: https://flaviocopes.com/use-react-component-in-astro/

First run `npx astro add react`

Then create `components/Test.jsx`

```javascript
export default function Test(props) {
  return <p>test</p>
}
```

Now in a `.astro` component import it:

```
import Test from '../components/Test'
```

and in its "JSX" include it:

`<Test />`

Done!

One gotcha: [React](https://flaviocopes.com/react/) components are rendered server-side, not client side, unless you add `client:load` to them:

`<Test client:load />`
