react-data-grid
react-data-grid copied to clipboard
`Error: useRowSelection must be used within DataGrid cells` bunping `7.0.0-beta.44` => `7.0.0-beta.47`
I have this custom leading header column renderer, worked fine until .44, after bumping to .47, it no longer works with following error.
Error: useRowSelection must be used within DataGrid cells
Perhaps the contributor know what this is about?
export const SelectColumn: CalculatedColumn<any, any> = {
key: "__gf_select",
name: "",
idx: 0,
width: 65,
maxWidth: 65,
resizable: false,
sortable: false,
frozen: true,
renderHeaderCell: (props: RenderHeaderCellProps<unknown>) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [isRowSelected, onRowSelectionChange] = useRowSelection();
return (
<SelectCellHeader
aria-label="Select All"
tabIndex={props.tabIndex}
value={isRowSelected}
onChange={(checked) =>
onRowSelectionChange({ type: "HEADER", checked })
}
/>
);
},
....