Does not seem to fully support styled-components?
See original GitHub issueI want to do this, passing the gatsby-image component `Img into a styled component, while animating it, like so:
const AnimatedImage = styled(motion(Img))`
width: 200px;
height: auto;
`
but this does not seem to work, giving me this error:
TypeError: Object(...) is not a function
Module.<anonymous>
src/pages/index.js:81
78 | }
79 | `
80 |
> 81 | const LaxImg = styled(motion(Img))`
82 | width: 200px;
83 | height: auto;
84 | `
it seems to work with regular html tags, just not react components, which is no bueno for me 😦
Am i doing something wrong? Is something like this not supported? It really needs to be supported, so hopefully I am doing something wrong or it’s on the way.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:25
Top Results From Across the Web
Why styled-components is not styling the whole component?
and to check if it is working I painted text with color:red but it seems it is not working, no styles are being...
Read more >How To Use Styled-Components In React - Smashing Magazine
If you look at the last example closely, you'll notice we didn't specify any HTML element to render. This is cool because we...
Read more >The styled-components Happy Path - Josh W Comeau
styled -components is a wonderfully powerful styling library for React, ... is not meant to serve as an introduction to styled-components, ...
Read more >Complete Guide On How To Use Styled-components In React
In Next.js, each page/component can have a dedicated style (CSS file). Conflicts do not exist because the styles from any CSS file will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I’m missing something - I don’t see any instance in this example of either a component made with styled components or a component using motion.custom
just to be clear, this works fine in
framer-motion
:…without seemingly any issues, just not this:
…which would be lovely if it did 😁