You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some scenarios where I need to add some additional functionality to existing react-table plugin hooks like useSortBy or useRowSelect. Is it an acceptable to do something like... Or what's the recommended approach?
function useMyRowSelect(hooks) {
useRowSelect(hooks);
hooks.useInstance.push(useInstance);
}
function useInstance(instance) {
const {
state: { selectedRowIds }
} = instance;
React.useEffect(() => {
// Do something with selected row IDs.
}, [deps]);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have some scenarios where I need to add some additional functionality to existing react-table plugin hooks like useSortBy or useRowSelect. Is it an acceptable to do something like... Or what's the recommended approach?
Thanks
Anand
Beta Was this translation helpful? Give feedback.
All reactions