super lightweight alternative to react-infinite
npm i @mochiya98/react-infinite-lite
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>
);
}
<script
src="https://unpkg.com/@mochiya98/react-infinite-lite"
crossorigin="anonymous"
></script>
<!-- window.ReactInfiniteLite -->
<script type="text/babel">
function App() {
return <ReactInfiniteLite>{/*...*/}</ReactInfiniteLite>;
}
</script>
timeScrollStateLastsForAfterUserScrolls
- can be implemented yourself by using handleScrolluseWindowAsScrollContainer
- not implemented yetdisplayBottomUpwards
- not implemented yetpreloadBatchSize
- simplified for performance(index%5)
optionalHeader: ReactNode
- add fixed header
- add missing
containerHeightScaleFactor
- update types
- rewrite with hooks
- add tests
- fix elementHeight behavior