Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@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.