Hi. I want to scroll to the id.
When it is at the top of the page, it works correctly, but if it is in the middle of the page or press the same link twice, it jumps to the top of the page.
Removing the onClick event will do the expected scrolling.
import { Link as Scroll } from 'react-scroll'; .... <Scroll onClick={() => setOpen(false)} smooth={true} to={item.to} duration={600} offset={-30}>{item.name}</Scroll>
Hi. I want to scroll to the id. When it is at the top of the page, it works correctly, but if it is in the middle of the page or press the same link twice, it jumps to the top of the page. Removing the onClick event will do the expected scrolling.
import { Link as Scroll } from 'react-scroll'; .... <Scroll onClick={() => setOpen(false)} smooth={true} to={item.to} duration={600} offset={-30}>{item.name}</Scroll>