3 ms·
Hi, the keys are used indeed in the example to prevent re-rendering. However, it does not prevent diffing the virtual dom. In other words, the new list with com
by mweststrate 11y ago
Hi, the keys are used indeed in the example to prevent re-rendering. However, it does not prevent diffing the virtual dom. In other words, the new list with components needs to be compared with the old list. That comparison is fast because the keys will match, but before that can be done, the map function that re-creates all the 20.000 components need to be executed still, which takes roughly 200ms which can be saved easily.