-
Hello, I have a use case which I think the library doesn't support (yet?). Would there be a way to hook into the end of the resizing event while in Making the component controlled cause a little bit of UI lag compared to the uncontrolled version, which I would like to avoid. Maybe the solution would be to add a The code I think of would look something like this: const [columnSizing, setColumnSizing] =
useLocalStorageState<ColumnSizingState>(
`local-storage-id`,
{
defaultValue: {},
}
)
const table = useReactTable({
data,
columns,
initialState: {
columnSizing,
},
columnResizeMode: 'onChange',
onColumnSizingEnd: setColumnSizing,
getCoreRowModel: getCoreRowModel(),
// ...
}) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Well, I kinda feel dumb as I didn't think about that earlier, onMouseUp={() => {
setColumnSizing(table.getState().columnSizing)
}} |
Beta Was this translation helpful? Give feedback.
-
You could also watch the table state for changes and trigger a side effect.
…On Jul 27, 2022, 2:54 PM -0600, Florian Knop ***@***.***>, wrote:
Well, I kinda feel dumb as I didn't think about that earlier,
But I simply ended up adding this on the resizer element :)
onMouseUp={() => {
setColumnSizing(table.getState().columnSizing)
}}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Well, I kinda feel dumb as I didn't think about that earlier,
But I simply ended up adding this on the resizer element :)