From c8857a28718b3d22f76562f1f7eaa4e01e568ec0 Mon Sep 17 00:00:00 2001 From: goldenLunchbox Date: Fri, 27 Sep 2019 13:43:13 +0200 Subject: [PATCH] Update api.md (#1551) The state variable seemed to be missing in the useTable part (row 481) and I felt the need to comment on an additional import being needed. --- docs/api.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 76f2067..125504b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -475,13 +475,14 @@ The following properties are available on every `Column` object returned by the ```js function Table({ columns, data }) { - // Set some default sorting state + // Set some default sorting state. For this an additional import of useTableState is needed const state = useTableState({ sortBy: [{ id: 'firstName', desc: true }] }) const { getTableProps, headerGroups, rows, prepareRow } = useTable( { columns, data, + state, }, useSortBy // Use the sortBy hook )