Skip to content

swiper/react onSlideChange's callback wouldn't be updated #3762

Closed
@ddhp

Description

@ddhp

This is a (multiple allowed):

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 because list 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions