Skip to content

Commit bb2ff87

Browse files
committed
Prettify code
1 parent ce56fb9 commit bb2ff87

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ export function genericHashLink(As) {
5252
reset();
5353
if (props.onClick) props.onClick(e);
5454
if (typeof props.to === 'string') {
55-
hashFragment = props.to
56-
.split('#')
57-
.slice(1)
58-
.join('#');
55+
hashFragment = props.to.split('#').slice(1).join('#');
5956
} else if (
6057
typeof props.to === 'object' &&
6158
typeof props.to.hash === 'string'
@@ -65,9 +62,9 @@ export function genericHashLink(As) {
6562
if (hashFragment !== '') {
6663
scrollFunction =
6764
props.scroll ||
68-
(el =>
65+
((el) =>
6966
props.smooth
70-
? el.scrollIntoView({ behavior: "smooth" })
67+
? el.scrollIntoView({ behavior: 'smooth' })
7168
: el.scrollIntoView());
7269
hashLinkScroll(props.timeout);
7370
}

0 commit comments

Comments
 (0)