【发布时间】:2022-08-03 01:27:16
【问题描述】:
我制作了一个动画,它由一个小屋和几朵漂浮在天空中的云组成。我想循环整个动画,但找不到正确的方法来实现它。这是我目前的做法。
const { rive, RiveComponent } = useRive({
src: Cabin,
autoplay: true,
onStop: () => {
if (window.location.href === \"http://localhost:8000/profile\") {
// check the url to prevent error when switching pages, which also makes the animation stop
rive.play()
}
}
})
它现在有效,但我仍然想知道是否有更清洁的方法来循环动画。
标签: reactjs animation frontend rive