Open darkyzhou opened 2 years ago
Probably we could use something like react-fast-compare?
Change in effect dependencies has been introduced in 2.6.0, so temporary fix is downgrade to 2.5.0
same the issue. I using inline and it re-render when i update state
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.function MyComponent() { const [list, setList] = useState([]) return <LightGallery selector="[data-my-image]" easing="ease-in-out" speed={300} startAnimationDuration={100} plugins={LIGHT_GALLERY_PLUGINS} download={true} mobileSettings={LIGHT_GALLERY_MOBILE_SETTINGS} enableSwipe={true} enableDrag={true}
Environment
Additional context
I think the bug is related to the usage of
restProps
: