docs: add select HOC docs to better document how to use the HOC (#733)

This commit is contained in:
Shaun Sweet
2018-02-08 09:58:24 -07:00
committed by Tanner Linsley
parent 3a8a037ee6
commit 6649b21abe
+5
View File
@@ -63,6 +63,11 @@ You include the HOC in the same manner as you would for the treeTableHOC but the
- toggleSelection - called when the use clicks a specific checkbox/radio in a row
- selectType - either `checkbox|radio` to indicate what type of selection is required
**Note:** The select field defaults to the accessor `_id` property in order to render the select field for that particular row. If your objects have different
unique ID fields, make sure to tell React Table that by passing it the `keyField` property.
```Javascript
<ReactTable keyField='id' />
```
In the case of `radio` there is no `selectAll` displayed but the developer is responsible for only making one selection in
the controlling component's state. You could select multiple but it wouldn't make sense and you should use `checkbox` instead.