diff options
Diffstat (limited to 'examples/framework-react')
-rw-r--r-- | examples/framework-react/.stackblitzrc | 6 | ||||
-rw-r--r-- | examples/framework-react/README.md | 35 |
2 files changed, 10 insertions, 31 deletions
diff --git a/examples/framework-react/.stackblitzrc b/examples/framework-react/.stackblitzrc new file mode 100644 index 000000000..43798ecff --- /dev/null +++ b/examples/framework-react/.stackblitzrc @@ -0,0 +1,6 @@ +{ + "startCommand": "npm start", + "env": { + "ENABLE_CJS_IMPORTS": true + } +}
\ No newline at end of file diff --git a/examples/framework-react/README.md b/examples/framework-react/README.md index 3701554be..f6f9a7941 100644 --- a/examples/framework-react/README.md +++ b/examples/framework-react/README.md @@ -1,38 +1,11 @@ -# Using React with Astro +# Astro + React Example -This example showcases Astro's built-in support for [React](https://reactjs.org/). - -## Installation - -### Automatic - -Bootstrap your Astro project with this template! - -```shell +``` npm init astro -- --template framework-react ``` -### Manual - -To use React components in your Astro project: - -1. Install `@astrojs/renderer-react` - - ```shell - npm i @astrojs/renderer-react - ``` - -2. Add `"@astrojs/renderer-react"` to your `renderers` in `astro.config.mjs`. - - ```js - export default { - renderers: [ - "@astrojs/renderer-react", - // optionally, others... - ] - } - ``` +[](https://stackblitz.com/github/snowpackjs/astro/tree/latest/examples/framework-react) -## Usage +This example showcases Astro working with [React](https://reactjs.org/). Write your React components as `.jsx` or `.tsx` files in your project. |