Skip to content

Commit f834e6d

Browse files
authored
Update README.md
Based on MDN documentation of `scrollIntoView` the options for `behavior` are `auto` and `smooth` not `instant`. Updating documentation to reflect that for users who read this for insight into how to write a custom scroll function (for things like offset for example). https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView#parameters
1 parent 21c81d8 commit f834e6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import { HashLink } from 'react-router-hash-link';
8989

9090
<HashLink
9191
to="/path#hash"
92-
scroll={(el) => el.scrollIntoView({ behavior: 'instant', block: 'end' })}
92+
scroll={(el) => el.scrollIntoView({ behavior: 'auto', block: 'end' })}
9393
>
9494
Link to Hash Fragment
9595
</HashLink>;

0 commit comments

Comments
 (0)