Scrollspy clone for react
npm install react-scrollspy-componentExisting solutions pollute the global space.
Scrollspy clone for react
class App extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
}
}
class Nav extends React.Component {
render(){
// To smooth scroll to one of the sections
// this.props.navTo('section1');
// Active Route
return this.props.active
}
}
Scrolling must happen in the scrollspy component. This allows us to keep all login in the scrollspy component, and keep things clean.