I was Trying to scroll to particular row item in react using ID of that item. I have the ID of particular row but not able to move there.
goToViolation=(id)=>{
const violation = id ;
window.scrollTo({
top:violation.current.offsetTop,
behavior:"smooth"});
};
if (isDrillDown) {
isRowSelected = index === rowIndex % 20;
if(isRowSelected){
this.goToViolation(row.id);
}
}
- i was getting the ID from this Condition and i am passing it to the above function and using scrollTo function.