startBunnyClient
startBunnyClient is the client-side entry point. It mounts your React app to the DOM, wraps it in StrictMode and Suspense, and registers the service worker in production.
import { startBunnyClient } from "@farbenmeer/bunny/client";Signature
Section titled “Signature”function startBunnyClient(app: ReactNode): voidParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
app | ReactNode | Your root React component. |
import { startBunnyClient } from "@farbenmeer/bunny/client";import { App } from "app/app";
startBunnyClient(<App />);What It Does
Section titled “What It Does”- Finds or creates a
<div id="__bunny">mount element. - Wraps your app in
<StrictMode>and<Suspense>. - Renders with
createRoot. - In development, preserves the React root across Vite hot module reloads.
- In production, registers the service worker at
/sw.js.
Client Exports
Section titled “Client Exports”The @farbenmeer/bunny/client entry re-exports everything from:
@farbenmeer/react-tapi— React hooks for TApi (useLacy, etc.).@farbenmeer/tapi/client—createFetchClientand other client utilities.
This means you can import all client-side TApi utilities from a single package:
import { createFetchClient, useLacy } from "@farbenmeer/bunny/client";