Just a simple button that brings you to the top of the page
Implementation
There are a few options:
1) Use native anchor tag with IDs to jump to that element
2) Use useRef to set current element to the Ref and then use element.scrollIntoView(), can make a more smooth transition
3) Use window.scrollTo(), which is similar to 1 without the re-rendering.
Potential Issues
Using an anchor tag could cause a re-rendering of the page which shouldn't be that big of an issue on it's own, but it could reset some progress done on the page.
Mockups / Screenshots
Features
Just a simple button that brings you to the top of the page
Implementation
There are a few options: 1) Use native anchor tag with IDs to jump to that element 2) Use useRef to set current element to the Ref and then use element.scrollIntoView(), can make a more smooth transition 3) Use window.scrollTo(), which is similar to 1 without the re-rendering.
Potential Issues