react-update-url-on-scroll
react-update-url-on-scroll copied to clipboard
Element = Null
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import ScrollableSection from 'react-update-url-on-scroll';
import { ViewLanding } from './components/views/ViewLanding';
import { Test } from './components/views/Test';
export const AppRoutes: React.FC = () => {
return (
<Router>
<ScrollableSection name="Intro" href="/">
<ViewLanding />
</ScrollableSection>
<ScrollableSection name="Test" href="test">
<Test />
</ScrollableSection>
</Router>
)
};
Console error:
scroll.js:56 Uncaught TypeError: Cannot read property 'offsetHeight' of null
at doesElementContainScrollTop (scroll.js:56)
at scroll.js:117
at Array.forEach (<anonymous>)
at getBestAnchorGivenScrollLocation (scroll.js:114)
at Manager.handleScroll (Manager.js:196)
at later (func.js:18)