From dbbe0f2ae13e73b8a10d93cb7cf5f556d92aad08 Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Thu, 9 Jan 2020 08:52:59 +0100 Subject: [PATCH] Fix the type of the components props of Trans. --- src/index.d.ts | 2 +- test/typescript/Trans.test.tsx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index d87d4ce81..256014674 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -33,7 +33,7 @@ export interface TransProps extends React.HTMLProps, Partial { children?: React.ReactNode; - components?: React.ReactNode[]; + components?: readonly React.ReactNode[]; count?: number; defaults?: string; i18n?: i18n; diff --git a/test/typescript/Trans.test.tsx b/test/typescript/Trans.test.tsx index 76bf82b64..6b25f1065 100644 --- a/test/typescript/Trans.test.tsx +++ b/test/typescript/Trans.test.tsx @@ -17,6 +17,11 @@ function components() { return ]}>Foo; } +function constComponents() { + const constArray = [
] as const; + return Foo; +} + function count() { return Foo; }