Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native - Android - Alert dialog cancelable false not working

Am new to react native, Am trying to show an alert dialog with cancelable : false It is not working. When I touch outside my dialog it is closing. Help me with this.

snippet:

Alert.alert(
 '',
 Strings.str_unexpected_error,
 [
   {text: 'OK', onPress: () => this.unexpectedBehavior()},
 ],
 {
   cancelable: false
 }
);
like image 661
SureshCS50 Avatar asked Nov 03 '16 13:11

SureshCS50


1 Answers

Posting this as answer, might help someone later.

I was using "react-native": "0.32.0". This issue was fixed in version 0.33.0 worked fine after updating to latest version (for now 0.36.0).

@Jickson Thanks for your help.

like image 120
SureshCS50 Avatar answered Oct 14 '22 00:10

SureshCS50