Skip to content

Commit 92a7388

Browse files
committed
Reset scroll on click
1 parent 374e2d3 commit 92a7388

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ function hashLinkScroll() {
4242

4343
export function HashLink(props) {
4444
function handleClick(e) {
45-
if (props.onClick) props.onClick(e);
4645
reset();
46+
if (props.onClick) props.onClick(e);
4747
if (typeof props.to === 'string') {
4848
hashFragment = props.to.split('#').slice(1).join('#');
4949
} else if (typeof props.to === 'object' && typeof props.to.hash === 'string') {

0 commit comments

Comments
 (0)