Closed alexmagwe closed 4 months ago
this error occurs when i try to auto scroll to a specific hash when the page loads when navigating from another page with the hash id in the URL. this is the code that does the auto scrolling:
useEffect(() => { if (!highlighterUtilsRef.current || highlights.length === 0) { return } const scrollToHighlightFromHash = () => { const highlight = getHighlightById(parseIdFromHash()) if (highlight && highlighterUtilsRef?.current) { highlighterUtilsRef.current.scrollToHighlight(highlight) } } scrollToHighlightFromHash() }, [getHighlightById, activeHighlight, highlights])
the solution is to make sure the useEffect is called within the pdfhighlighter context
this error occurs when i try to auto scroll to a specific hash when the page loads when navigating from another page with the hash id in the URL. this is the code that does the auto scrolling: