원클릭으로
react
React and Expo integration guide for Better Translate providers, hooks, and typed translation access.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
React and Expo integration guide for Better Translate providers, hooks, and typed translation access.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Extract source strings, generate locale files, and remove unused keys for Better Translate projects.
Expo and React Native integration guide using Better Translate React support.
Package map and reading order for Better Translate product skills.
Guide for combining Better Translate packages without duplicating translation ownership.
Smallest Better Translate setup for plain TypeScript, Node.js, Bun, APIs, and shared libraries.
Map of Better Translate example apps to copy from when starting a new integration.
| name | react |
| description | React and Expo integration guide for Better Translate providers, hooks, and typed translation access. |
Use this guide when React components need translations and locale switching.
@better-translate/core@better-translate/react@better-translate/coreBetterTranslateProvideruseTranslations()import { BetterTranslateProvider } from "@better-translate/react";
import { translator } from "./i18n";
export function Root() {
return (
<BetterTranslateProvider translator={translator}>
<App />
</BetterTranslateProvider>
);
}
The simplest no-extra-generic setup is to bind the translator once and export an app-local provider + hook pair.
createBetterTranslateReact(translator)import { createBetterTranslateReact } from "@better-translate/react";
import { translator } from "./i18n";
export const { BetterTranslateProvider, useTranslations } =
createBetterTranslateReact(translator);
Then import your app-local useTranslations instead of importing the package hook directly:
import { useTranslations } from "./i18n";
export function Header() {
const { t } = useTranslations();
return <h1>{t("home.title")}</h1>;
}
These fallback patterns are still supported too.
import { useTranslations } from "@better-translate/react";
import { translator } from "./i18n";
export function Header() {
const { locale, setLocale, t } = useTranslations<typeof translator>();
return (
<>
<h1>{t("home.title")}</h1>
<button onClick={() => setLocale("es")} disabled={locale === "es"}>
Espanol
</button>
</>
);
}
useTranslations()Create src/better-translate.d.ts:
import { translator } from "./i18n";
declare module "@better-translate/react" {
interface BetterTranslateReactTypes {
translator: typeof translator;
}
}
Then components can use the hook without a generic and still keep autocomplete:
import { useTranslations } from "@better-translate/react";
export function Header() {
const { t } = useTranslations();
return <h1>{t("home.title")}</h1>;
}
React by itself is enough for:
If the app is Next.js App Router, keep @better-translate/react for client hooks and add @better-translate/nextjs for routing and server helpers.