Skip to content

Remove all selected rows even though I'm in other page #2902

Discussion options

You must be logged in to vote

I solved the issue by using stateReducer option.

  stateReducer: (newState, action) => {
    switch (action.type) {
      case 'toggleAllRowsSelected':
        return {
          ...newState,
          selectedRowIds: {},
        };

      default:
        return newState;
    }
  }

Reference: https://react-table.tanstack.com/docs/api/useTable

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by peraltafederico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant