diff --git a/index.d.ts b/index.d.ts index 310b48f3..01233083 100644 --- a/index.d.ts +++ b/index.d.ts @@ -34,7 +34,7 @@ export interface TransProps extends React.HTMLProps, Partial { children?: React.ReactNode; - components?: readonly React.ReactNode[] | { readonly [tagName: string]: React.ReactNode }; + components?: readonly React.ReactElement[] | { readonly [tagName: string]: React.ReactElement }; count?: number; context?: string; defaults?: string; diff --git a/package.json b/package.json index 2fa8512b..b9cd5103 100644 --- a/package.json +++ b/package.json @@ -117,9 +117,9 @@ "test:watch": "cross-env BABEL_ENV=development jest --no-cache --watch", "test:coverage": "cross-env BABEL_ENV=development jest --no-cache --coverage", "test:lint": "eslint ./src ./test", - "test:typescript": "tslint --project tsconfig.json '**/*.ts'", - "test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json '**/*.ts'", - "test:typescript:customtypes": "tslint --project ./test/typescript/custom-types/tsconfig.json '**/*.ts'", + "test:typescript": "tslint --project tsconfig.json '**/*.{ts,tsx}'", + "test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json '**/*.{ts,tsx}'", + "test:typescript:customtypes": "tslint --project ./test/typescript/custom-types/tsconfig.json '**/*.{ts,tsx}'", "contributors:add": "all-contributors add", "contributors:generate": "all-contributors generate", "prettier": "prettier --write \"{,**/}*.{ts,tsx,js,json,md}\"" diff --git a/test/typescript/Trans.test.tsx b/test/typescript/Trans.test.tsx index da1ea1a2..038ab159 100644 --- a/test/typescript/Trans.test.tsx +++ b/test/typescript/Trans.test.tsx @@ -26,6 +26,14 @@ function objectComponents() { return }} defaults="Hello " />; } +function MyComponent() { + return <>world; +} + +function objectCustomComponents() { + return }} defaults="Hello " />; +} + function constObjectComponents() { const constObject = { Btn: