Open cknabe opened 1 year ago
Found while working to add TS types for DataTableSkeleton: https://github.com/carbon-design-system/carbon/issues/12516
The DataTable propType for headers is:
headers: PropTypes.arrayOf( PropTypes.shape({ key: PropTypes.string.isRequired, header: PropTypes.node.isRequired, }) ).isRequired,
The DataTableSkeleton propType for headers is:
headers: PropTypes.oneOfType([ PropTypes.array, PropTypes.shape({ key: PropTypes.string, }), ]),
DataTableSkeleton's usage of headers:
{headers ? ( <div className="bx--table-header-label"> {headers[i]?.header} </div> ) : ( <span/> )}
Yes, thanks for opening this issue. We'll slate to tackle it in v12 due to it needing a breaking change.
Found while working to add TS types for DataTableSkeleton: https://github.com/carbon-design-system/carbon/issues/12516
The DataTable propType for headers is:
The DataTableSkeleton propType for headers is:
DataTableSkeleton's usage of headers: