T
TanStack3y ago
deep-jade

Handle column visibility from a dedicated component

How can we create a ColumnVisibility component that lives as a sibling of the component creating the table? I tried creating a context in the parent component, getting the reference to the table in the ColumnVisibility component and readapting the code form the example but the checkboxes I use to determine what is visible don't get checked/unchecked until I close and reopen the column visibility dropdown.
1 Reply
deep-jade
deep-jadeOP3y ago
alexbu92
CodeSandbox
infallible-gates-q9q6j0 - CodeSandbox
infallible-gates-q9q6j0 by alexbu92 using @headlessui/react, @heroicons/react, @tanstack/react-table, classnames, heroicons, react, react-dom, react-scripts

Did you find this page helpful?