mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Fix or suppress errors in react-native
Reviewed By: jeffmo Differential Revision: D3209973 fb-gh-sync-id: bdc9b4afc0b187b1b16fa6bfb1c34adb4089ab81 fbshipit-source-id: bdc9b4afc0b187b1b16fa6bfb1c34adb4089ab81
This commit is contained in:
committed by
Facebook Github Bot 0
parent
5a93877673
commit
91d4a093ea
@@ -34,6 +34,18 @@ const RCTModalHostView = requireNativeComponent('RCTModalHostView', null);
|
||||
* configureScene property.
|
||||
*/
|
||||
class Modal extends React.Component {
|
||||
static propTypes = {
|
||||
animated: PropTypes.bool,
|
||||
transparent: PropTypes.bool,
|
||||
visible: PropTypes.bool,
|
||||
onRequestClose: Platform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func,
|
||||
onShow: PropTypes.func,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
visible: true,
|
||||
};
|
||||
|
||||
render(): ?ReactElement {
|
||||
if (this.props.visible === false) {
|
||||
return null;
|
||||
@@ -65,18 +77,6 @@ class Modal extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
Modal.propTypes = {
|
||||
animated: PropTypes.bool,
|
||||
transparent: PropTypes.bool,
|
||||
visible: PropTypes.bool,
|
||||
onRequestClose: Platform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func,
|
||||
onShow: PropTypes.func,
|
||||
};
|
||||
|
||||
Modal.defaultProps = {
|
||||
visible: true,
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
modal: {
|
||||
position: 'absolute',
|
||||
|
||||
Reference in New Issue
Block a user