Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic images with Pagination #116

Open
darpan-stagebit opened this issue Feb 15, 2024 · 1 comment
Open

Dynamic images with Pagination #116

darpan-stagebit opened this issue Feb 15, 2024 · 1 comment

Comments

@darpan-stagebit
Copy link

How can we append additional images loaded with pagination from some kind of API calls?

@zvonimirr
Copy link
Contributor

As an 'image' is just a child element you could do something like this:

const [images, setImages] = useState([]);

useEffect(function fetchImages() {
  // fetch images...
}, []);

return <Masonry>{images.map(image => <img src={image.src} />)}</Masonry>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants