Vite
Installation
Follow the installation docs in the Introduction.
Usage
In any component, import Xeet
from react-xeet
and use it like so:
import { Xeet } from 'react-xeet'
export const IndexPage = () => <Xeet id="1628832338187636740" />
You can learn more about Xeet
in the X theme docs.
Running the test app
Clone the react-xeet
(opens in a new tab) repository and then run the following command:
pnpm install && pnpm dev --filter=vite-app...
The app will be up and running at http://localhost:5173 (opens in a new tab) for the Vite app example (opens in a new tab).
The app shows the usage of react-xeet
in different scenarios:
- localhost:5173/ (opens in a new tab) renders a single xeet.
- localhost:5173/xeet/1629307668568633344 (opens in a new tab) renders dynamic xeets with SWR.
Xeet
already uses SWR and this page shows how to implement it manually.
The source code for react-xeet
is imported from packages/react-xeet (opens in a new tab) and any changes you make to it will be reflected in the app immediately.