Skip to content

Commit 08d8242

Browse files
committed
update type
1 parent 0b8b9db commit 08d8242

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/Cell/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ const getTitleFromCellRenderChildren = ({
6969
if (typeof children === 'string' || typeof children === 'number') {
7070
title = children.toString();
7171
} else if (
72-
React.isValidElement<React.PropsWithChildren<any>>(children) &&
73-
typeof children.props.children === 'string'
72+
React.isValidElement<any>(children) &&
73+
typeof (children.props as any)?.children === 'string'
7474
) {
75-
title = children.props.children;
75+
title = (children.props as any)?.children;
7676
}
7777
}
7878
return title;

src/hooks/useColumns/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ export function convertChildrenToColumns<RecordType>(
2020
children: React.ReactNode,
2121
): ColumnsType<RecordType> {
2222
return toArray(children)
23-
.filter(node => React.isValidElement<React.PropsWithChildren<any>>(node))
24-
.map(({ key, props }) => {
23+
.filter(node => React.isValidElement<any>(node))
24+
.map(node => {
25+
const { key, props } = node as React.ReactElement<any>;
2526
const { children: nodeChildren, ...restProps } = props;
2627
const column = {
2728
key,

0 commit comments

Comments
 (0)