Open allomorphy opened 2 years ago
A solution should be to add a key
attribute with the index value to the <rect>
element:
<g>
{values.map((value, i) => (
<rect key={i} x={0} y={i * barHeight} width={scale(value)} height={barHeight - 1} fill={theme.palette.greenBase} />
))}
</g>
sorry, what tutorial is this referencing?
Thanks for this great example.
I had to make the map loop static in order to compile around this error. Here is the way I did it.
It would be great if someone could suggest how to loop without such an error. Thanks a lot in advance 😊