Skip to content

Commit

Permalink
refactor(i18n): make components prop required for <Translate>
Browse files Browse the repository at this point in the history
Rationale: We prefer that people use the `useTranslation` hook instead,
as it has a lower overhead. The only two use cases we're tailoring for
is when you need to use React components as part of the translation resource,
or you are using a non-functional component and thus cannot use hooks.
  • Loading branch information
rexxars committed Oct 5, 2023
1 parent 112d5e6 commit 85741a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sanity/src/core/i18n/Translate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ComponentMap = Record<string, ComponentType<{children?: ReactNode}>>
export interface TranslationProps {
t: TFunction
i18nKey: string
components?: ComponentMap
components: ComponentMap
values?: Record<string, string | string[]>
}

Expand Down

0 comments on commit 85741a6

Please sign in to comment.