In the React app I'm building, I would like a button to be hidden until certain conditions are met. Then I'd to animate it in from underneath another element. At the moment I am always rendering the button and adding a class of "hidden" when I'd like it hidden. The SASS looking something like this:
button {
display: inline-block;
width: 100%;
height: 63px;
transition: height 250ms ease-in-out;
font-size: 24px;
&.hidden {
height: 0;
}
}
But when the button hides, the element gets smaller, but the text is still visible. Similar to this: https://jsfiddle.net/dtu56e1j/
What am I doing wrong? Or is there a better way to get a button to animate in?