Created
August 28, 2019 19:06
-
-
Save NicholasKuchiniski/ed0a87be0a9d9b19b43378f0eedaedfa to your computer and use it in GitHub Desktop.
example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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