Inline styles do not support keyframes. There is a hacky way of doing it using insertRule API. But is always better to bind a css class which implements this animations to a conditional attribution and merge the styles together using string interpolation or clsx /classnames like libraries. Or even jss dynamic styles
Here, check out styled-components. This will do what you are looking for, plus the bonus benefit of using proper CSS. stackoverflow.com/a/43500934/5066625
This will do what you are looking for actually it does a different thing. The reason why I'm asking this question is because I'm coding in a legacy react project. That is why I'm trying to use it inline (everything in the project is inline)
insertRule API. But is always better to bind a css class which implements this animations to a conditional attribution and merge the styles together using string interpolation orclsx/classnameslike libraries. Or even jss dynamic stylesstyled-components. This will do what you are looking for, plus the bonus benefit of using proper CSS. stackoverflow.com/a/43500934/5066625This will do what you are looking foractually it does a different thing. The reason why I'm asking this question is because I'm coding in a legacy react project. That is why I'm trying to use it inline (everything in the project is inline)