Description
This is a (multiple allowed):
-
bug
-
enhancement
-
feature-discussion (RFC)
-
Swiper Version: 6.1.1
-
Platform/Target and Browser Versions: macOS
-
Live Link or JSFiddle/Codepen or website with isssue: https://codesandbox.io/s/swiper-event-listener-5h5jo?file=/src/App.js
What you did
A callback in my react component is set to swiper/react component, and I want to update that function
Expected Behavior
callback function would be updated
Actual Behavior
please refer to the provided codesandbox link, reproducing steps:
- click the random button, the list is updated
- change active slide with navigation, the
List in onSlideChange Cb
wouldn't be updated becauselist
in the callback stays the same
I am not sure if this is related to how event listeners are updated to the swiper instance from react component. I quickly checked the source code but I can't find any clue. I think it might be much easier to look for help here so if someone can give me some hint that would be really appreciated!