mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 23:28:12 +00:00
Make 'onRequestClose' a required prop for Modal on Android. Fixes #6612
Summary:The `onRequestClose` prop can be used to handle dismissing the modal by back button. It's pretty easy to miss the `onRequestClose` prop on Android. So making it a required prop makes sure that it generates a warning when not supplied. Context #6612 Closes https://github.com/facebook/react-native/pull/6667 Differential Revision: D3102054 Pulled By: javache fb-gh-sync-id: 878240606285d231b5592a438918e441765bfe5f fbshipit-source-id: 878240606285d231b5592a438918e441765bfe5f
This commit is contained in:
parent
d0f6a1a13e
commit
ce81f8b35a
@ -11,6 +11,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var Platform = require('Platform');
|
||||
var PropTypes = require('ReactPropTypes');
|
||||
var React = require('React');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
@ -61,7 +62,7 @@ Modal.propTypes = {
|
||||
animated: PropTypes.bool,
|
||||
transparent: PropTypes.bool,
|
||||
visible: PropTypes.bool,
|
||||
onRequestClose: PropTypes.func,
|
||||
onRequestClose: Platform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func,
|
||||
onShow: PropTypes.func,
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user