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.
<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.
import { JuliyaSentenceText } from '@oddmash/juliya/react/server';
<JuliyaSentenceText locale="en">Read every line naturally.</JuliyaSentenceText>| Option | Required | Default | Purpose |
|---|---|---|---|
children | Required | - | Original string (not JSX) |
as | Optional | span | Rendered element |
locale | Optional | ko | Language rules; React also reads the nearest Provider |
forcedBreaks | Optional | - | 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.
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.