Closed gundamftw closed 4 years ago
Hmm.. Would you mind posting your code here? Think I know what the issue is.
EDIT: your .map() implementation should suffice.
I highly suspect that you gave your array of components new key
values on each render which will cause every component to re-render. This would then be a problem with your implementation, and not this library. Please re-open this issue if you still believe there's any issues. :-)
I am populating a bunch of eyedropper buttons using array map. Each button has 2 functions, on change, it will grab the rgb value and a value that I passed in. The second function is changing the button background color to the sampled color.
The problem with this is that every time I sampled a color, the Button component will be mapped again for the entire array. If I have like 20 elements in the array, it will run 20 times even though I was only using one eyedropper. In comparison, the function I passed into onChange doesn't have this problem.