Browse Source

fix: paramter type error (#24429)

* fix: paramter type error

* feat: adjust

* feat: add type.test.tsx
pull/24787/head
zoomdong 5 years ago
committed by GitHub
parent
commit
37e9c6b111
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/tree/Tree.tsx
  2. 13
      components/tree/__tests__/type.test.tsx

2
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;
}

13
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();
});
});
Loading…
Cancel
Save