Add sortBy example

This commit is contained in:
tannerlinsley
2019-07-23 12:21:57 -06:00
parent 824ee34ba9
commit 0716e234a1
19 changed files with 10648 additions and 9 deletions
+5 -9
View File
@@ -1,6 +1,6 @@
import React from 'react'
import styled from 'styled-components'
import { useTable, useColumns, useRows } from 'react-table'
import { useTable } from 'react-table'
import makeData from './makeData'
@@ -35,14 +35,10 @@ const Styles = styled.div`
function Table({ columns, data }) {
// Use the state and functions returned from useTable to build your UI
const { getTableProps, headerGroups, rows, prepareRow } = useTable(
{
columns,
data,
},
useColumns,
useRows
)
const { getTableProps, headerGroups, rows, prepareRow } = useTable({
columns,
data,
})
// Render the UI for your table
return (