diff --git a/components/tree/Tree.tsx b/components/tree/Tree.tsx index 8d0af000cc..43b52fbd95 100644 --- a/components/tree/Tree.tsx +++ b/components/tree/Tree.tsx @@ -41,7 +41,7 @@ export interface AntTreeNodeProps { selected?: boolean; selectable?: boolean; icon?: ((treeNode: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode; - children?: React.ReactNode; + children?: React.ReactElement[]; [customProp: string]: any; } diff --git a/components/tree/__tests__/type.test.tsx b/components/tree/__tests__/type.test.tsx new file mode 100644 index 0000000000..57f938b6a1 --- /dev/null +++ b/components/tree/__tests__/type.test.tsx @@ -0,0 +1,13 @@ +/* eslint-disable */ +import * as React from 'react'; +import { AntTreeNodeProps } from '../Tree'; + +describe('Tree TypeScript Test', async () => { + it('AntTreeNodeProps', () => { + const tree: AntTreeNodeProps = { + children: [React.createElement('h1')], + }; + + expect(tree).toBeTruthy(); + }); +});