Reactなどで、css animationをかけている要素に対して、 中身の小要素が変わったときにサイドアニメーションをリスタートさせる方法です。 課題 propsが変更されても、中身が変わるだけなのでアニメーションは再実行されない。 const animTarget = (props:Props) => { return ( <Animation>{props.children}</Animation> ) } const Animation = styled` animation: ${xxx} 0.4s 0.6s ease-out forwards; ` const animTarget = (props:Props) => { if (document.querySelectorAll('.tar')) { Array.from(document.querySelectorAll