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
When table data changes, the state is set to the initial state. Is there a way to prevent this behavior?
Background: I have a table that can be edited by multiple users and each user wants to have the latest data. The data passed to the table is controlled by a component that adds rows through websockets. Now when one user is using the table and another user adds a row the table state is set to the initial state.
I managed to preserve the state using the stateReducer hook. This works because when table data changes two actions are issued, 'resetSortBy' and 'resetPage' (using useSortBy and usePagination).
This way seems very susceptible and I am not sure about side effects, so is there a better/intended way to archive the same behavior ?
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
Uh oh!
There was an error while loading. Please reload this page.
-
When table data changes, the state is set to the initial state. Is there a way to prevent this behavior?
Background: I have a table that can be edited by multiple users and each user wants to have the latest data. The data passed to the table is controlled by a component that adds rows through websockets. Now when one user is using the table and another user adds a row the table state is set to the initial state.
I managed to preserve the state using the stateReducer hook. This works because when table data changes two actions are issued, 'resetSortBy' and 'resetPage' (using useSortBy and usePagination).
This way seems very susceptible and I am not sure about side effects, so is there a better/intended way to archive the same behavior ?
Beta Was this translation helpful? Give feedback.
All reactions