Scrollspy component
$ npm i react-scrollspy
var Scrollspy = require('react-scrollspy').Scrollspy;
...
<div>
<div>
<section id="section-1">section 1</section>
<section id="section-2">section 2</section>
<section id="section-3">section 3</section>
</div>
<Scrollspy items={ ['section-1', 'section-2', 'section-3'] } currentClassName="is-current">
<li><a href="#section-1">section 1</a></li>
<li><a href="#section-2">section 2</a></li>
<li><a href="#section-3">section 3</a></li>
</Scrollspy>
</div>
The id list of target contents.
The class name that apply to the navigation element paired with the content element in viewport.
$ git clone https://github.com/makotot/react-scrollspy.git
$ cd react-scrollspy
$ npm i
$ npm run start
Pull requests and Reporting a issue are always welcome :)
MIT