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

pagination support? updating imageData props? #4

Open
petahbred opened this issue Jul 27, 2019 · 1 comment
Open

pagination support? updating imageData props? #4

petahbred opened this issue Jul 27, 2019 · 1 comment

Comments

@petahbred
Copy link

Hi,

Thanks for creating PIG react library!

Will there be support for pagination and/or being able to update the imageData prop so that new files will just be appended to the bottom of the view?

Thanks

@vincentjflorio
Copy link

@petahbred I had another solution for a gallery before that was paginated, and after switching to this, I tried to use state changes to update my imageData prop and it didn't work -- what did work is wrapping it with something and setting a key for both wrapper and Pig.

My understanding is there are so many callbacks and memos to keep this thing speedy that it's going to dig its claws in to avoid a change if it can. So I made the key a JSON stringified sliced array of whatever the images are. In our project they're so likely to never have the same order that each update changes that string, forced a re-render.

Not sure how an infinite scroll approach would work, perhaps through concatenating after the same process?

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