Within my React-based application, I am attempting to execute a basic CSS3 width transition with the following code:
.foo {
transition: width 1s ease-in-out;
}
My objective is to apply a style to an element in the React component which is "width: xx%" and then animate it from 0% to xx%. However, due to the element having this property upon rendering, the animation fails to work. Even after exploring "ReactCSSTransitionGroup", I have not been able to find a solution. I have even tried using setTimeOut to set the style attribute after the component has been rendered, but this approach feels messy and like a hack. Can anyone provide guidance on the correct approach to achieving this?