I'm pretty new on React JS. I saw a lot of similar questions about getting the top of the page with React Router, etc. But my question is not about React Router, it's just about React JS itself.
I'm working on a one page, and I'm wondering how can I get the top of my page every time I refresh this page. I mean, when I refresh the page, I'm still at the same place. I tried this :
componentDidMount(){
window.scrollTo(0, 0);
}
But it does not working. Of course, I tried all things people recommended on similar subjects.
Any other ideas ?