Skip to content

Commit 37e9c6b

Browse files
authored
fix: paramter type error (#24429)
* fix: paramter type error * feat: adjust * feat: add type.test.tsx
1 parent 8e00e59 commit 37e9c6b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

components/tree/Tree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface AntTreeNodeProps {
4141
selected?: boolean;
4242
selectable?: boolean;
4343
icon?: ((treeNode: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode;
44-
children?: React.ReactNode;
44+
children?: React.ReactElement[];
4545
[customProp: string]: any;
4646
}
4747

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable */
2+
import * as React from 'react';
3+
import { AntTreeNodeProps } from '../Tree';
4+
5+
describe('Tree TypeScript Test', async () => {
6+
it('AntTreeNodeProps', () => {
7+
const tree: AntTreeNodeProps = {
8+
children: [React.createElement('h1')],
9+
};
10+
11+
expect(tree).toBeTruthy();
12+
});
13+
});

0 commit comments

Comments
 (0)