mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
582220c8a1
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
public | ||
src | ||
.gitignore | ||
.npmrc | ||
astro.config.mjs | ||
package.json | ||
README.md | ||
tsconfig.json |
Using Preact with Astro
This example showcases Astro's built-in support for Preact.
Installation
Automatic
Bootstrap your Astro project with this template!
npm init astro -- --template framework-preact
Manual
To use Preact components in your Astro project:
-
Install
@astrojs/renderer-preact
npm i @astrojs/renderer-preact
-
Add
"@astrojs/renderer-preact"
to yourrenderers
inastro.config.mjs
.export default { renderers: [ "@astrojs/renderer-preact", // optionally, others... ] }
Usage
Write your Preact components as .jsx
or .tsx
files in your project.