How to target a not Found Element with react-scroll library?

Viewed 166

import { scroller } from "react-scroll";

I have a component DataView which conditionally renders in another component RenderData which renders the data as cards. There are 3 sections in RenderData which is operated by a menu ... and it renders according to a property in DataView.

Now I use scroller.scrollTo(id, {smooth: true, duration: 500, spy: true, exact: true, offset: -79,}) through a button to scroll to any card specified with the id

But in the console Target Element not found is output.

Is there a reason why this is happening? I've heard it's because of 2 scrollbars, but I can't see 2 scrollbars (is there a way to possibly show them)? If not, is there any other way to smooth scroll to id? Thanks

0 Answers
Related