
useRowSelectuseRowSelect is the hook that implements basic row selection. For more information on row selection, see Row Selection
The following options are supported via the main options object passed to useTable(options)
initialState.selectedRowIds: Object<rowId: Boolean>{}true in this object, it will have a selected state.manualRowSelectedKey: StringisSelectedautoResetSelectedRows: Booleantruetrue, the selectedRowIds state will automatically reset if any of the following conditions are met:data is changedfalseThe following values are provided to the table instance:
toggleRowSelected: Function(rowPath: String, ?set: Bool) => voidtrue or false to set it to that statetoggleAllRowsSelected: Function(?set: Bool) => voidtrue or false to set all rows to that statetoggleAllPageRowsSelected: Function(?set: Bool) => voidtrue or false to set all rows to that stategetToggleAllPageRowsSelectedProps: Function(props) => propsonChange: Function()style.cursor: 'pointer'checked: Boolindeterminate: Booltitle: 'Toggle All Rows Selected'getToggleAllRowsSelectedProps: Function(props) => propsonChange: Function()style.cursor: 'pointer'checked: Boolindeterminate: Booltitle: 'Toggle All Rows Selected'isAllRowsSelected: Booltrue if all rows are selected.falseselectedFlatRows: Array<Row>The following additional properties are available on every prepared row object returned by the table instance.
isSelected: Booltrue if the row is currently selectedisSomeSelected: Booltrue if the row has subRows and at least one of them is currently selectedtoggleRowSelected: Function(?set)true or false to set it to that stategetToggleRowSelectedProps: Function(props) => propsonChange: Function()style.cursor: 'pointer'checked: Booltitle: 'Toggle Row Selected'The best JavaScript newsletter! Delivered every Monday to over 76,000 devs.