React-id-swiper: Swipe events

Created on 5 Jun 2018  路  4Comments  路  Source: kidjp85/react-id-swiper

Hi, thank you very much for this contribution, i was unable to listen for events like 'on swipe' event.
can anyone show me how to do so? i will be very thankful!!

Most helpful comment

Hi @mbenjrinija , u can add event from params like

params = {
    on: {
        'init': () => {}
        'slideChange': () => {......}
    }
}

More detail about event api is here

All 4 comments

It's ok guys i found it,
<Swiper ref={node => { if (node) this.swiper = node.swiper; this.swiper.on('slideChange', function () { console.log('slide changed'); }); }} > {renderedItems} </Swiper>

Hi @mbenjrinija , u can add event from params like

params = {
    on: {
        'init': () => {}
        'slideChange': () => {......}
    }
}

More detail about event api is here

Hi

Why am I getting this error suddenly ....
index.js:1375 Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()

Hi @mbenjrinija , u can add event from params like

params = {
    on: {
        'init': () => {}
        'slideChange': () => {......}
    }
}

More detail about event api is here

thanks!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nerdyman picture nerdyman  路  3Comments

thientran1707 picture thientran1707  路  3Comments

ositaka picture ositaka  路  4Comments

Alexandrdrdr picture Alexandrdrdr  路  3Comments

cweise picture cweise  路  6Comments