@saykit/react
v0.1.0
Published
React integration for saykit, i18n hooks and components
Maintainers
Readme
@saykit/react
React integration for SayKit.
A <Say> component for rendering translated content in server and client components, a <SayProvider> and useSay() for client trees, and a small server runtime (setSay, getSay, unstable_createWithSay).
Install
pnpm add @saykit/react saykitYou will also need a SayKit build-tool plugin and a saykit.config.ts.
Usage
import { Say, SayProvider } from '@saykit/react/client';
function App() {
return (
<SayProvider locale="fr" messages={fr}>
<Say>Hello, {name}!</Say>
<Say.Plural _={count} one="# item" other="# items" />
</SayProvider>
);
}