DefinitelyTyped/types/react-scrollspy/react-scrollspy-tests.tsx
2019-02-12 15:59:43 +08:00

23 lines
709 B
TypeScript

import * as React from 'react';
import Scrollspy from 'react-scrollspy';
const items: string[] = ['section-1', 'section-2', 'section-3'];
function TestComponent() {
return (
<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={items} 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>
);
}