DocsAdvanced

SSR and hydration

The server cannot know the browser's actual font or width. JuliyaSentenceText groups sentences without browser APIs and requires an explicit locale for languages other than Korean. It cannot read the client JuliyaProvider. JuliyaText measures after hydration.

React and Next.js

JuliyaText initially preserves original text and explicit breaks. The client measures the actual layout after hydration.

tsx
<JuliyaText as="h1" locale="en">Read every line naturally.</JuliyaText>

Server Component API

JuliyaSentenceText groups sentences without browser APIs and cannot inherit a client Provider. Pass the locale directly.

tsx
import { JuliyaSentenceText } from '@oddmash/juliya/react/server';

<JuliyaSentenceText locale="en">Read every line naturally.</JuliyaSentenceText>
OptionRequiredDefaultPurpose
childrenRequired-Original string (not JSX)
asOptionalspanRendered element
localeOptionalkoLanguage rules; React also reads the nearest Provider
forcedBreaksOptional-Source UTF-16 boundary offsets

Forced breaks and first paint

Use the same splitLines result from source and forced break positions on server and client.

ts
const initialLines = splitLines(text, forcedBreaks);

Framework-independent SSR

Render source text and explicit breaks first, then mount the chosen browser adapter.

Cautions

Actual font and width are unavailable on the server. Font loading can reflow content; keep the original text accessible.