Skip to content

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";
function startBunnyClient(app: ReactNode): void
ParameterTypeDescription
appReactNodeYour root React component.
import { startBunnyClient } from "@farbenmeer/bunny/client";
import { App } from "app/app";
startBunnyClient(<App />);
  1. Finds or creates a <div id="__bunny"> mount element.
  2. Wraps your app in <StrictMode> and <Suspense>.
  3. Renders with createRoot.
  4. In development, preserves the React root across Vite hot module reloads.
  5. In production, registers the service worker at /sw.js.

The @farbenmeer/bunny/client entry re-exports everything from:

  • @farbenmeer/react-tapi — React hooks for TApi (useLacy, etc.).
  • @farbenmeer/tapi/clientcreateFetchClient and other client utilities.

This means you can import all client-side TApi utilities from a single package:

import { createFetchClient, useLacy } from "@farbenmeer/bunny/client";