Skip to content

Instantly share code, notes, and snippets.

@NicholasKuchiniski
Created August 28, 2019 19:06
Show Gist options
  • Save NicholasKuchiniski/ed0a87be0a9d9b19b43378f0eedaedfa to your computer and use it in GitHub Desktop.
Save NicholasKuchiniski/ed0a87be0a9d9b19b43378f0eedaedfa to your computer and use it in GitHub Desktop.
example
const DataTable = ({ data }) => {
const [items, setItems] = useState();
const remove = () => {
///...
}
const fetchMoreData = () => {
setTimeout(() => {
setItems([data, ...data])
})
}
return (
<React.Fragment>
<Typography>Listagem</Typography>
<InfiniteScroll
dataLength={items.length}
next={fetchMoreData}
hasMore={true}
loader={<h4>Loading...</h4>}
>
...
</InfiniteScroll>
<React.Fragment>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment