Skip to content

Commit 093639b

Browse files
committed
React 19 type fixes
1 parent e80cf89 commit 093639b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

website/src/components/APITable/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ interface Props {
2626
function getRowName(node: ReactElement): string {
2727
let curNode: ReactNode = node;
2828
while (isValidElement(curNode)) {
29-
[curNode] = React.Children.toArray(curNode.props.children);
29+
[curNode] = React.Children.toArray(
30+
(curNode.props as {children: ReactNode}).children,
31+
);
3032
}
3133
if (typeof curNode !== 'string') {
3234
throw new Error(
@@ -99,6 +101,7 @@ export default function APITable({children, name}: Props): ReactNode {
99101
highlightedRow.current?.focus();
100102
}, [highlightedRow]);
101103
const rows = React.Children.map(
104+
// @ts-expect-error: TODO fix typing
102105
tbody.props.children,
103106
(row: ReactElement<ComponentProps<'tr'>>) => (
104107
<APITableRowComp name={name} ref={highlightedRow}>

0 commit comments

Comments
 (0)