The other answer given was for react-table that didn’t use react hooks (< v7). In order to sort a column (or columns) when the table is built, you just have to set the sortBy array on the initialState in the useTable hook.
const {
getTableProps,
getTableBodyProps,
...
} = useTable(
{
columns,
....,
initialState: {
sortBy: [
{
id: 'columnId',
desc: false
}
]
}
}