react-swipeable-views icon indicating copy to clipboard operation
react-swipeable-views copied to clipboard

onChangeIndex callback don't response

Open ghost opened this issue 5 years ago • 1 comments

Hello community my mistake is simple, when using the onChangeIndex prop and calling the callback it doesn't work.

attached code

const handleStepChange = (step) => {

       setActive(step);
       console.log('hello world')

    };

For example, changing the status is no problem, but if I try to print on the console its step parameter does not.

Does anyone know why? The above is just an example, my concern is that the function does not respond to me.

<SwipeableViews onChangeIndex={handleStepChange} ... /> ...

Am I doing something wrong?

ghost avatar Jul 09 '20 19:07 ghost

Seems so. Here's that function working in a sandbox.

caleb-harrelson avatar Aug 14 '20 04:08 caleb-harrelson