scroll animation
Unanswered
Sun bear posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Sun bearOP
is there better way to do scroll
4 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Sun bearOP
const handleScroll = () => {
questionRef.current?.nextElementSibling?.scrollIntoView({
behavior: "smooth",
});
};
const handleClick = (answer: string) => {
if (answer === question.answer) {
setScore((prev: number) => prev + 1);
if (scrollOn) {
requestAnimationFrame(() => {
questionRef.current?.nextElementSibling?.scrollIntoView({
behavior: "smooth",
});
});
}
}
};
when i choose some answer sirtly some blocks are rendered and after that scrolled to next sibling
![Image](https://cdn.discordapp.com/attachments/1125006317195636797/1125006721656561715/image.png)
but at some moment its annyoing when you see 2 thing happen at the same time