You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the bug is related to the usage of restProps:
// Lightgallery.tsx// ...constLG: React.FC<LightGalleryProps>=({
children,// ...
onFlipVertical,
...restProps}: LightGalleryProps)=>{const$lg=React.useRef<HTMLDivElement>(null);constregisterEvents=// ...React.useEffect(()=>{registerEvents();constlightGallery=LightGallery(($lg.currentasunknown)asHTMLElement,restProps,);returnfunctioncleanup(){lightGallery.destroy();};// ⚠️⚠️⚠️// Here the reference `resetProps` ALWAYS differ on each render.// By temporarily removing it, the bug disappears. So a possible solution// might be manually do a deep check on the properties of `restProps`// ⚠️⚠️⚠️},[registerEvents,restProps]);return// ...};exportdefaultLG;
The text was updated successfully, but these errors were encountered:
Description
My LightGallery component always create a new
LightGallery
instance on each render.Steps to reproduce
setList()
is called, LightGallery always create a newLightGallery
instance.Environment
Additional context
I think the bug is related to the usage of
restProps
:The text was updated successfully, but these errors were encountered: