autoPlay HOC eats the meta parameter of onChangeIndex
Closed this issue · 0 comments
cbargren commented
The meta
parameter of the onChangeIndex
callback is not present when using the autoPlay HOC. This is because it is not passed from the wrapped component back out to the callback. See here
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
The meta
parameter should be provided to the onChangeIndex
callback function when using the autoPlay
HOC utility.
Current Behavior
The meta
parameter is not passed to the callback.
Steps to Reproduce (for bugs)
- https://codesandbox.io/s/create-react-app-yr31x
- Note in the console that logs triggered by autoplay do not have a meta param, while ones triggered by the base component do
Context
I was trying to stop the autoplay from running after the user manually swipes the slides or interacts with the slides in another way, but don't have a way to detect what triggered the slide change since the meta param is missing.
Your Environment
See sandbox