Fix key unicity on PitComponents#87
Conversation
|
|
||
| return ( | ||
| <PitComponent key={n} style={pitStyle}>{n}</PitComponent> | ||
| <PitComponent key={`${n}_PC_${index}`} style={pitStyle}>{n}</PitComponent> |
There was a problem hiding this comment.
Why are the pit points not unique?
Regardless, if there's nothing unique about the item, just key={index} is sufficient - anything else is just a waste.
There was a problem hiding this comment.
Ok, I took the wrong direction. My first idea was to add small CSS blocs on top of others to manage the height of the pit points (that leads to not unique pit points...)
So if I have to put only 1 pit point per value, how do you manage the height of the point ? When the component is rendered outside the lib, I don't have enough information to calculate its height...
Thank you,
Sylvain
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Hello guys,
thank you for this great component ! I use it in my project, that contains a lot of other REACT components. Unfortunately, I have warnings indicating that the key of the PitComponent is not unique. I quickly updated the value of the "key" attribute that is generating to make it more "unique"...
Does I missed something, or is that the good way to do it ?
Thanks,
Sylvain