Closed pmgzo closed 3 years ago
You should pass in a cancelButtonIndex
or at least guard against an undefined i
when calling setSelectedKind
.
Thank you for you answer, I wanted to say that I received an undefined i
in that callback which
is not the expected type precised here: https://github.com/expo/react-native-action-sheet/blob/master/src/types.ts#L5.
I propose to specify that same parameter to be either of type number
or type undefined
.
Thanks for the clarification!
:tada: This issue has been resolved in version 3.12.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
In what cases can it be undefined? If cancelButtonIndex
is passed, is it guaranteed it won't be? Thanks!
In what cases can it be undefined? If
cancelButtonIndex
is passed, is it guaranteed it won't be? Thanks!
What i wanted to say is just add the undefined
type in typescript. Because the cancelButtonIndex
is just acting at runtime.
But yes, if you specify cancelButton it should work as expected !
Hi,
I would like to open this issue because I had some trouble with my app.
When my action sheet is displayed and I clicked on the return button of my emulator, the buttonIndex callback is triggered and I got parameter i as undefined that cause my app to crash. I thought that this parameter type was of type number: https://github.com/expo/react-native-action-sheet/blob/master/src/types.ts#L5
I also considered this pr: https://github.com/expo/react-native-action-sheet/pull/102, but I'm not sure to understand the point. Is it possible that this callback is not called if we click on the return button ? Are we obliged to put a cancel button on the action sheet to get the expected behavior ?