This PR introduces a new smooth feature, which will scroll to top of the page using a smooth animation.
The feature is opt-in and disabled by default. Internally, it uses window.scrollTo handler. It has fairly good support in browsers, but is unfortunately not supported by Safari yet.
Tested locally on Chrome and Firefox (both latest).
Implemented changes
Added --save flag to npm installation instruction.
Updated props table within the README file to reflect the new prop and added an additional paragraph about the internal implementation.
Updated type Props to include the new smooth prop and aligned other props with the code.
Altered scrollToTop function.
Altered className prop to have an empty string by default (otherwise it producess a class of "undefined scroll-to-top").
Fixes #1
This PR introduces a new
smooth
feature, which will scroll to top of the page using a smooth animation.The feature is opt-in and disabled by default. Internally, it uses
window.scrollTo
handler. It has fairly good support in browsers, but is unfortunately not supported by Safari yet.Tested locally on Chrome and Firefox (both latest).
Implemented changes
--save
flag to npm installation instruction.type Props
to include the newsmooth
prop and aligned other props with the code.scrollToTop
function.className
prop to have an empty string by default (otherwise it producess a class of"undefined scroll-to-top"
).0.2.0
.