npm.io
0.2.1 • Published yesterday

@saykit/react

Licence
MIT
Version
0.2.1
Deps
1
Size
16 kB
Vulns
0
Weekly
0
Stars
6

@saykit/react

React integration for SayKit.

Coverage

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 saykit

You 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>
  );
}

Documentation

React integration guide at saykit.js.org.

Keywords