The Scroll To Top button is a very helpful navigation tool that brings the user to the top of a page without them having to scroll all the way up. On a blog it is very useful. In this tutorial I will show you how to implement this feature with React and MaterialUI.
Top comments (7)
Thank you very much. This solves the error of findDomNode deprecated while using the material UI example BackToTop from there documents . It was a bothersome error.
Awesome. That is great to hear
Yeah it was easier I guess your way rather than using const Transition = React.forwardRef(function Transition(props, ref) {
return ;}); to make the fix (for material ui's back to top example) which I think would have worked because findDomNode is deprecated but after using a forward ref the error did disappear on other elements. Material UI i think is slowly fixing this or at least showing how to fix in docs but some things still show that annoying error so you have to put forward ref on a bunch of things. Beats shutting off strict mode though.
thank you it's easy !
You can use one JSX element to create that button
How can you create a Scroll To Top button with just HTML?.
Kavindu Santhusa γ» Dec 24 γ» 2 min read
How can we implement this SHOWBELOW thing in a class component?
That was pretty useful! Thank you so much!