Skip to content

Events not triggering #7103

Answered by Koreanderson
MikeDrenth asked this question in Q&A
Oct 11, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

@MikeDrenth

To attach event listeners as props you have to update the syntax slightly for React components:

<Swiper
    onSlideChange={() => {console.log('onChange')}}
    onInit={() => {console.log('onInit'}}
    ...
  >

As per docs here: https://swiperjs.com/react#swiper-props

Replies: 1 comment 1 reply

Comment options

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

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