-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animating shadowOffset
doesn’t work
#688
Comments
Related: animatedjs/animated#55 |
This is a duplicate of #353. Bad issue browsing on my part. I agree, this likely belongs in animated, but |
Does this work in |
Yeah, totally does (GIF from demo). |
Yeah the problem is upstream in the AnimatedStyle ( AnimatedStyle ( Since the |
Hmm, I see. Looks react-native has a package.json and build process, but it's not being built/published with the rest of react-native. I’ll open an issue and see if they're open to fixing their build script and publishing react-animated alongside react-native. |
Closing / folding this issue into #716 |
Do you want to request a feature or report a bug?
🐛 Bug!
What is the current behavior?
Animating
shadowOffset
’sheight
orwidth
doesn’t work.Example code (see below for full demo link):
This error manifests in a
JSON.stringify
error logged to the console:This comes from
src/propTypes/createStrictShapeTypeChecker
’sJSON.stringify
call. The real problem is the propTypes validation error:It looks like
props.style.shadowOffset.height
is anAnimatedInterpolation
instance, and its current value isn't being assigned to theheight
property. I dug around looking for how animation classes are passed to animated and retrieved. Can we fix the “FlattenStyle” injection so animated can detect/interpolate its deeply nested classes?If the current behavior is a bug, please provide the steps to reproduce and
if a minimal demo of the problem via Glitch or similar (template:
https://glitch.com/edit/#!/react-native-web-playground).
I made an example project to show the bug. Specifically, check out swashcap/react-native-shadow-animation/Button.js
What is the expected behavior?
I expect animating
shadowOffset
’sheight
andwidth
would work, and display similar to react-native (see example project GIF).Environment (include versions). Did this work in previous versions?
The text was updated successfully, but these errors were encountered: