Skip to content
Discussion options

You must be logged in to vote

@realrnvr

Thanks for reporting this! You've uncovered a genuine bug — when the index prop changes rapidly (e.g., from a slider during drag), the lightbox's internal state sync can fall one render behind, causing on.view to fire with a stale index value. This creates a feedback loop where the parent state and lightbox state chase each other indefinitely.

I'll create a ticket to fix the root cause on the library side (see #395 for updates).

In the meantime, wrapping the index with useDeferredValue before passing it to the lightbox is a solid workaround — and arguably a good practice regardless of this bug, since it lets React deprioritize the lightbox update during rapid input and keeps the…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@igordanchenko
Comment options

Answer selected by realrnvr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants