'smooth animation of the size of a functional component during state change
As you can see, by clicking on the component underneath, we can change its size. I would like to make a transition between those sizes. Is it possible with CSSTransition ?
export const Liste_planete2 = () => {
const [height, setHeight] = useState<number>(30)
const handleClick=()=>{
setHeight(height+30)
}
return(
<div style={{height:height}} onClick={handleClick}>
Text
</div>
)
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
