() => {
const Example = () => {
const Component = () => {
const text = useTranslation("component.text", { fallback: "My fallback" });
return <p>{text}</p>;
};
return (
<>
<Component />
<TranslationContext.Provider
value={{ component: { text: "My translated text" } }}
>
<Component />
</TranslationContext.Provider>
</>
);
}
}