I have a div with adding a class by condition
<div
className={`${
showLinks ? "links-container show-container" : "links-container"
}`}
>
And some styles
.links-container {
height: 0;
overflow: hidden;
transition: all 0.3s linear;
}
.show-container {
height: 10rem;
}
So when the component is render/rerender, a smooth div extension animation is triggered thanks to my transition style. How it works? Is this css or react rules?