-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
First of all I'd like to thank you for this package,
I'm getting this error raised on Sentry:
TypeError apply(react-anchor-link-smooth-scroll/lib/anchor-link) error
Cannot read property 'getBoundingClientRect' of null
And I think it would be great to silent it by providing $anchor var with something like this:
var $anchor = document.getElementById(id);
var offsetTop = $anchor && $anchor.getBoundingClientRect().top + window.pageYOffset;Or use optional chaining:
var $anchor = document?.getElementById(id);
var offsetTop = $anchor?.getBoundingClientRect().top + window.pageYOffset;ZkrZbr, jorgearturonh, LandonSchropp, kamal-choudhary and n3oAlex
Metadata
Metadata
Assignees
Labels
No labels
