Files
DefinitelyTyped/types/react-lazyload/react-lazyload-tests.tsx
makoto abe d82cb80219 Add type definitions for react-lazyload package. (#16807)
* Add type definitions for `react-lazyload` package.

* fix lint error.

* fix TypeScript Version
2017-05-31 23:39:55 -07:00

33 lines
813 B
TypeScript

import * as React from "react";
import LazyLoad from "react-lazyload";
interface State {
arr: string[];
}
class Normal extends React.Component<{}, State> {
constructor() {
super();
let arr: string[] = [];
for (let i = 0; i < 200; i++) {
arr.push(`${i}`);
}
this.state = { arr };
}
render() {
return (
<div>
{this.state.arr.map((el, index) => {
return (
<LazyLoad once={true} key={index} height={200} offset={50}>
<p id={`${index}`} >
count={index + 1}
</p>
</LazyLoad>
);
})}
</div>
);
}
}