|
22 | 22 | * SOFTWARE. |
23 | 23 | */ |
24 | 24 |
|
25 | | -import { Component, Children, isValidElement } from 'react' |
| 25 | +import { Component, Children, isValidElement, ReactElement } from 'react' |
26 | 26 |
|
27 | 27 | import { safeCloneElement, omitProps } from '@instructure/ui-react-utils' |
28 | 28 | import { View } from '@instructure/ui-view' |
@@ -92,9 +92,9 @@ class Table extends Component<TableProps> { |
92 | 92 | getHeaders() { |
93 | 93 | const [headChild] = Children.toArray(this.props.children) |
94 | 94 | if (!headChild || !isValidElement(headChild)) return undefined |
95 | | - const [firstRow] = Children.toArray(headChild.props.children) |
| 95 | + const [firstRow] = Children.toArray((headChild as ReactElement<any>).props.children) |
96 | 96 | if (!firstRow || !isValidElement(firstRow)) return undefined |
97 | | - return Children.map(firstRow.props.children, (colHeader) => { |
| 97 | + return Children.map((firstRow as ReactElement<any>).props.children, (colHeader) => { |
98 | 98 | if (!isValidElement<{ children?: any }>(colHeader)) return undefined |
99 | 99 | return colHeader.props.children |
100 | 100 | }) |
@@ -132,7 +132,7 @@ class Table extends Component<TableProps> { |
132 | 132 | )} |
133 | 133 | {Children.map(children, (child) => { |
134 | 134 | if (isValidElement(child)) { |
135 | | - return safeCloneElement(child, { key: child.props.name }) |
| 135 | + return safeCloneElement(child, { key: (child as ReactElement<any>).props.name }) |
136 | 136 | } |
137 | 137 | return child |
138 | 138 | })} |
|
0 commit comments