In a single-page application in react, when the mobile end moves from page A to page B, the initial position of page B is the location of page A. How can we make the scrollTop of B page 0?

For a single-page application in

react, when the mobile end moves from page A to page B, the initial position of page B is the location of page A. How can I make the scrollTop of B page 0

Mar.04,2021

of course, enforce

on the b page.
componentWillMount(){
    document.documentElement.scrollTop = 0;
}

but basically you should check to see if there is something wrong with the route you wrote.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb0e8b-480ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb0e8b-480ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?