Skip to content

Custom key for data to prevent wrong state after immutable update of the data #2145

Answered by omridevk
omridevk asked this question in General
Discussion options

You must be logged in to vote

k, I think I found a solution:
using getRowId,
then pass it a callback

  const getRowId = React.useCallback(row => {
    return row.id
  }, [])

and there I can adjust the id to be my unique key in my data so when I change it property on it the table state is kept.
wish it was easier to find it.

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@omridevk
Comment options

@giranm
Comment options

Answer selected by omridevk
Comment options

You must be logged in to vote
1 reply
@omridevk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants