I was using React-virtualized table and it has a very useful prop called scrollToIndex that was doing the job.
However, I had to get rid of the library and use my own JSX.
Now I have a big list of projects as follows:-
render() {
return(
<div className="container">
{projects.map(project => (
<ProjectRow
key={project.id}
project={project}
/>
))}
)};
Now let's assume projects array has more than 100 projects and I want to scroll initially to the middle of it, let's say project at index 50.
How to do that?
I tried using useRef() and createRef() on the div itself but without any scucess.