Open pthieu opened 7 years ago
Upon some reading: https://github.com/bencripps/react-redux-grid/blob/master/docs/CREATE_KEY_FROM.md
It seems that even if your child is at another parent, if they have they same _key
, it's going to conflict.
What's the correct structure to have the same child in multiple parents: i.e.:
{
adult1: {
children: [{
id: 'child1'
}]
}
adult2:
children: [{
id: 'child1'
}]
}
Kind of how a child shoes
can show up under a parent sports
or luxury
In this scenario, since your keys are not unique you shouldn't be specifying the createKeyFrom
property. Grid will create unique keys by default (it just won't be as performant).
@bencripps: so would i pass in createKeyFrom: false
as a parameter to disable?
That should work, but you could also not pass in the property at all. I believe it defaults to false.
Originally I did not pass it in at all and was still getting this error. Let me try it with it explicitly set to false
.
Any update on this?
I'm getting a unique key conflict, I know this is a react error, but I can seem to debug it. I make sure that all the ID's are unique in each array of children, but this still pops up:
My tree looks somewhat like a normal nested tree seen in most of this repo:
Sometimes the a nested array of children may have some of the same elements as other arrays of children, but every individual array of children will not have duplicated
id
. Been trying to debug this for a while, is there a way to quickly see what the two conflicts are? I checkRedux-Devtools
for the conflict but they're not in the state so I can't see which elements are in conflict.