mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fa97b2383c
Summary: Solve #25016 Use `OK` as default text for the affirmative button if no text is specified. When setting an alert on android with button configuration, and no `text` field specified no button is shown on the alert. This makes it impossible to dismiss. An example of how this can happen is creating a simple button where a `onPress` callback is used but no text is specified: ``` Alert.alert( 'title', 'message', [ { onPress: () => console.log('onPress') } ], ) ``` Does not change the current behavior of no text button configurations on iOS. On iOS at least one button is always shown, and buttons with no text can be displayed. Behavior on setting multiple buttons is a little wonky, but this PR does not aim to solve it. I did test these cases and included some examples below. ## Changelog [Android] [Fixed] - Use OK as default text on Android Alert if button configuration specified without text Pull Request resolved: https://github.com/facebook/react-native/pull/25033 Differential Revision: D15502780 Pulled By: cpojer fbshipit-source-id: 505a9940f4588f4c10e25b67bfed8b8a1e610c69