[styles] Arrow functions (with or without props) do not work within makeStyles for @keyframes #21011
Labels
bug 🐛
Something doesn't work
package: styles
Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Milestone
I want to dynamically generate an
@keyframes
animation using themakeStyles
helper.I want to access props within
makeStyles
to generate this css keyframes.However, it does not seem to work.
Current Behavior 😯
Passing an arrow function (with or without props) to
@keyframes
does not generate the animation.Expected Behavior 🤔
Being able to use props to generate
@keyframes
rulesThere is a workaround for dynamically generating
@keyframes
with the es6 spread operator, but it does not work with props.Steps to Reproduce 🕹
Live example (CodeSandox)
Steps:
@keyframes
animationContext 🔦
I want to create dynamic animation rules, based on a number of items that is being rendered. So I want to be able to use props within the component to define the resulting animation.
Right now, within
makeStyles
, I have to use:but I want to be able to use:
and within
MyComponent
:Your Environment 🌎
The text was updated successfully, but these errors were encountered: