【发布时间】:2021-12-11 10:15:27
【问题描述】:
const animate_boxes = () => {
inner_ref.current.style.transform = "scale(0)";
setTimeout(() => {
if (inner_ref && inner_ref.current) {
inner_ref.current.style.transform = "scale(1)";
}
}, 200);
};
useEffect(() => {
animate_boxes();
}, [trigger])
目前,我就是这样做的。
这是标准/良好的做法吗? 如果没有,我该如何重新编写上面的代码来简化?
【问题讨论】:
标签: javascript html css reactjs frontend