@mochiya98/react-infinite-lite
v0.2.1
Published
lightweight alternative to react-infinite
Downloads
4
Maintainers
Readme
@mochiya98/react-infinite-lite
super lightweight alternative to react-infinite
Installation
npm i @mochiya98/react-infinite-lite
Usage
same as react-infinite
(easy migration from react-infinite)
see more details in seatgeek/react-infinite README
import Infinite from "@mochiya98/react-infinite-lite";
function App() {
return (
<Infinite containerHeight={100} elementHeight={30}>
<div className="hoge">1</div>
<div className="hoge">2</div>
{/*...*/}
</Infinite>
);
}
CDN
<script
src="https://unpkg.com/@mochiya98/react-infinite-lite"
crossorigin="anonymous"
></script>
<!-- window.ReactInfiniteLite -->
<script type="text/babel">
function App() {
return <ReactInfiniteLite>{/*...*/}</ReactInfiniteLite>;
}
</script>
Unsupported features
timeScrollStateLastsForAfterUserScrolls
- can be implemented yourself by using handleScrolluseWindowAsScrollContainer
- not implemented yetdisplayBottomUpwards
- not implemented yetpreloadBatchSize
- simplified for performance(index%5)
Additional features
optionalHeader: ReactNode
- add fixed header
Changelog
0.2.1 - 2020-07-05
- add missing
containerHeightScaleFactor
- update types
0.2.0 - 2020-05-07
- rewrite with hooks
- add tests
- fix elementHeight behavior