navigation scroll react 1

navigation scroll react

import { Link } from "react-scroll";


// somewhere in your markup
Test

// somewhere else in your markup. This is where it will scroll to.
...

Here is what the above code is Doing:
1. The Link component is used to link to another element on the page.
2. The to prop is used to specify the id of the element you want to scroll to.
3. The spy prop is used to tell the component to update the active class on the Link component when the target is scrolled into view.
4. The smooth prop is used to tell the component to animate the scrolling.
5. The offset prop is used to specify the number of pixels to offset the scrolling position.
6. The duration prop is used to specify the number of milliseconds for the scrolling duration.

Similar Posts