Skip to content

Using props and animation in styled components #776

Answered by NikRoe
alinarub asked this question in Web
Discussion options

You must be logged in to vote

Hi there,

the error message suggests that in addition to the keyframe helper, you will also need the css helper from styled-components.
Those lines of code would then look like this:

${({ $hamburgerOpen }) => css`
    animation: ${$hamburgerOpen ? customAnimationIn : customAnimationOut} 100ms
      ease-in-out forwards;
  `}

don't forget to import { css } from "styled-components"

Hope this already enables you to take the next steps in finding a great fade out animation :)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gregorsart
Comment options

Answer selected by alinarub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
3 participants