[9.0.0-beta.34] destructuring in useTransition does not work in build
See original GitHub issue🐛 Bug Report
@react-spring/web
and react-spring
builds are behaving strangely and giving errors where they didn’t previously
When importing @react-spring/web
from codesandbox, I see this error
$csb__animated.extendAnimated is not a function
Switching to react-spring
I see this error from useTransition
Cannot destructure property 'ref' of 'props' as it is null.
To Reproduce
Basic useSpring/useTransition usage with 9.0.0-beta.34
Link to repro (highly encouraged)
Basic useTransition show/hide @react-spring/web 9.0.0-beta.34
https://codesandbox.io/s/quiet-cloud-sill4?file=/src/App.js
Basic useTransition show/hide react-spring 9.0.0-beta.34
https://codesandbox.io/s/blazing-fast-w529r?file=/src/App.js
I’ve noticed this has completely broken my library react-spring-lightbox https://codesandbox.io/s/react-spring-lightbox-mosaic-71hts?fontsize=14&module=/src/ImageGallery/index.js&file=/src/ImageGallery/index.js
Environment
@react-spring/web
v9.0.0-beta.34react
v16.13.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
@tim-soft The API for
useTransition
changed in V9 but it’s not documented on react-spring.io. If you make these changes, it will resolve the issue.Remove the key selector from useTransitions(), as it’s now automatic:
const transitions = useTransition(toggle, null, {
toconst transitions = useTransition(toggle, {
Call
transitions
instead of mapping it:transitions.map(({ item, key, props }) => ...)
totransitions((props, item, key) => ...)
@joshuaellis The issue is just a documentation issue.
Getting the same error here with
^9.0.0-rc.3
, using the example pulled right from the docs. Any advice?