react-spring: useTrail wont re animate if count of items stays the same.
π Bug Report
(A clear and concise description of what the bug is.)
To Reproduce
Try to animate your list while keeping the length of the list same Steps to reproduce the behavior:
Expected behavior
Should animate even if count stays the same.
Link to repro (highly encouraged)
https://codesandbox.io/s/sweet-hooks-xgpse?fontsize=14
Environment
react-spring
v8.x.xreact
v16.8.x (orreact-native
v0.58.x)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (7 by maintainers)
Try set
reset: true
https://www.react-spring.io/docs/hooks/api, works for me.There is a change in state and that is not a react issue. The implementation of react spring probably uses useEffect to detect changes and its being based on length/ count. There should be deeper detection like item.key to see if items have changed.
Could you display on sandbox how to do it to achieve what we are discussing?
after playing around I donβt see how useTransition can help me.