Skip to content

Commit

Permalink
Spread state and initialState
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszbachorski committed Oct 1, 2024
1 parent efd1c8e commit e5d2b38
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export const useDataTable = <Data>({
columns,
data,
pageSize = 50,
state,
initialState,
...props
}: UseDataTableProps<Data>) => {
const [globalFilter, setGlobalFilter] = useState('')
Expand All @@ -75,11 +77,12 @@ export const useDataTable = <Data>({
getSortedRowModel: getSortedRowModel(),
getPaginationRowModel: getPaginationRowModel(),
onGlobalFilterChange: setGlobalFilter,
state: { globalFilter },
state: { globalFilter, ...state },
initialState: {
pagination: {
pageSize,
},
...initialState,
},
...props,
})
Expand Down

0 comments on commit e5d2b38

Please sign in to comment.