Skip to content

Commit

Permalink
fix clickHandler declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
toviszsolt committed Mar 27, 2024
1 parent 3249ef3 commit 8898969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/ScrollSpy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ declare function ScrollSpy(props: {
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,

/** Function that will be called internally */
clickHandler: (
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
handler: () => void,
container: HTMLElement,
) => void,
clickHandler: () => void,

/** Container element that is being scrolled */
container: HTMLElement,
Expand Down
5 changes: 5 additions & 0 deletions src/_.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const _ = () => {
root={document.getElementById('root')}
rootMargin="-60px 0px 0px 0px"
threshold={0}
onClickEach={(e, next, container) => {
console.log('The clicked element:', e.target);
console.log('The container element of target:', container);
next();
}}
>
<div>bruh</div>
</ScrollSpy>
Expand Down

0 comments on commit 8898969

Please sign in to comment.