-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Integrate with Animated #892
Comments
Like I said on Twitter, for anyone who is having the same trouble and reading this 😄 You'll have to pass all your animated values into the inline styles i.e. On React Native we should be able to support this stuff somehow, but on SC for Web it's going to be tricky since we're currently not parsing for inline styles. |
@philpl Out of curiosity, does this mean that if your using |
@jbovenschen no, animations with animated do work since all the logic for it is in their own components. Check the animations section in our docs |
I had an issue with styled-components and an animated component created with Stackoverflow question. Someone know why ? Thanks, Luca |
@lpillonel I haven't looked into that methods exact implementation, but what does work is wrapping an animated component in a styled one which is also recommended in our docs: https://www.styled-components.com/docs/basics#animations Please note that it's always better to ask for help on our spectrum or Gitter, and check out the docs first. Also I must politely ask you to create a new issue when you can't find an answer instead of commenting on one. Sorry, but it's better to remind people about it once in a while 😉 |
My bad, sorry. But your answer fixed my problem : ) |
I know this is an old issue, but to share a solution I've been using with latest version of styled-components ( const StyledView = styled.View`
background: hotpink;
`;
<StyledView as={Animated.View} {...props} /> |
doesn't work over here with as={Animated.View} |
This works but it seems to be a bit buggy - it doesn't seem to interpolate properly, in other words, the element jumps from one state to the other if it starts from the middle of an animation:
and it throws this error:
|
This works! thanks @breadadams |
Thank you @breadadams. You bring us a good solution! |
I use styled-components( |
const StyledView = styled(Animated.View)`
background: hotpink;
`; I use styled-components ( 5.1.1 ) and it works for me! |
It works but I get |
I second this! Absolutely works on my version of Thank you @breadadams |
Ever any luck here? |
It would be really great if we could integrate styled-components with Animated.
As of now I haven't found a way to pass Animated-values as props to styled-components,
so a tighter integration would be really helpful and would make a killer combo for dealing with animations and css in both React and React Native.
The text was updated successfully, but these errors were encountered: