plus1tv / react-anime

✨ (ノ´ヮ´)ノ*:・゚✧ A super easy animation library for React!
https://codepen.io/collection/nrkjgo/
MIT License
1.55k stars 81 forks source link

if you use Date.now() or combine anything with Date.now() at key={} attribute. #62

Closed cizz3007 closed 4 years ago

cizz3007 commented 4 years ago

if you use Date.now() or combine anything with Date.now() at key={} attribute. every component will re-rendered on every update. it's shit. every trigger that you are doing is cause re-rendering component

Originally posted by @cizz3007 in https://github.com/hyperfuse/react-anime/issues/43#issuecomment-549718279

benbot commented 4 years ago

That's actually a behavior of react. If the key prop changes between updates than a component will re render.