ReactJS: scroll to top position when navigating between pages
I’m encountering an issue in my ReactJS application where, upon navigating to a new page, the page automatically scrolls down to a position below the top of the page instead of starting from the top (generally it takes scroll position from the previous page). This behavior is inconsistent with typical page navigation where the new page should load from the top.
ReactJS: Retaining scroll position when navigating between pages
I’m encountering an issue in my ReactJS application where, upon navigating to a new page, the page automatically scrolls down to a position below the top of the page instead of starting from the top (generally it takes scroll position from the previous page). This behavior is inconsistent with typical page navigation where the new page should load from the top.
Why doesn’t component render conditionally on reactJS
So I’ve wrapped a component with <Link>
tag. So when I click it, the url is changing to /product/1 as expected.