DefinitelyTyped/types/react-infinite-scroll-component/react-infinite-scroll-component-tests.tsx
Marcelo Cardoso 71452535fe [react-infinite-scroll-component] Add className type and test (#36382)
* fix: added missing typing
1. Added missing `className` definition

* fix: set className to go through tests
2019-06-24 12:39:12 -07:00

16 lines
443 B
TypeScript

import * as React from 'react';
import * as InfiniteScroll from 'react-infinite-scroll-component';
const options: JSX.Element[] = [<div key="1">1</div>, <div key="2">2</div>];
const props: InfiniteScroll.InfiniteScrollProps = {
dataLength: 4,
hasMore: true,
endMessage: 'The end.',
loader: <h3>Loading...</h3>,
next: () => null,
className: 'this-is-a-test',
};
<InfiniteScroll {...props}>{options}</InfiniteScroll>;