Comparing children using fast equal check instead of just length
With previous implementation, when children changed the animation did not work. This PR fixes that.
Theoretically children can be string, null etc. And I am expecting here components with key property so there is obviously room for improvement.
Thanks for the PR. I think we need a real deep check here. There are 2 problems with your solution:
- If the children don't have keys (e.g. only one child) it will result in an error and will break current projects
- Many people use the array index for the key, so we will have the same problem as before
I hope I'll find some time in the next days, so I'll try to implement a real deep equal check.
Maybe this could work: https://github.com/FormidableLabs/react-fast-compare
Ha, I haven’t thought about looking for existing package. Just went with simplest approach for my needs. I will see if I have time over the weekend, then I can submit better PR.
All you comments are obviously valid 👍