I recently upgraded my styled-components from v3 to v4. The below css ${jquery} animation line would work on v3 but cannot seem to get it working on v4.
const StyledGlide = styled(Glide)`
animation: ${ifProp("isOpen", `0.8s ${slideInRightAnimation}`, `0.9s ${fadeOutLeftAnimation} forwards`)};
`
I get this error: It seems you are interpolating a keyframe declaration (ifGrPa) into an untagged string. This was supported in styled-components v3, but is no longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css`` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css
I tried changing the syntax but can't seem to get it right.
const StyledGlide = styled(Glide)`
animation: ${ifProp("isOpen", css\`0.8s ${slideInRightAnimation}`, `0.9s ${fadeOutLeftAnimation} forwards\`)};
`
ifProp
? – delisisOpen: PropTypes.bool
– WelshifProp
(seems to be a function) – delisconst animationStyles = { animation: css
${fadeIn} 0.5s, };
. Can you please me to resolve this? – Bonzo