From 85741a6e243369d16222366c55c7d164bb661c98 Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Wed, 27 Sep 2023 17:56:32 +0100 Subject: [PATCH] refactor(i18n): make `components` prop required for 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. --- packages/sanity/src/core/i18n/Translate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sanity/src/core/i18n/Translate.tsx b/packages/sanity/src/core/i18n/Translate.tsx index fb849ebc84b0..ffe6041d9330 100644 --- a/packages/sanity/src/core/i18n/Translate.tsx +++ b/packages/sanity/src/core/i18n/Translate.tsx @@ -10,7 +10,7 @@ type ComponentMap = Record> export interface TranslationProps { t: TFunction i18nKey: string - components?: ComponentMap + components: ComponentMap values?: Record }