Skip to content

Commit 7d66d8e

Browse files
committed
Add comment to scrollTo function
1 parent 849cb6d commit 7d66d8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Smooth scrolling onClick event handler
3+
* @param {string} selector argument will be passed to `querySelector`, usually an HTML id
4+
*/
15
const scrollTo = (selector) => {
26
document.querySelector(selector).scrollIntoView({
37
behavior: 'smooth',

0 commit comments

Comments
 (0)