From 92109b8a0c7f2fc67c37ddad84e2b30b3a1eadad Mon Sep 17 00:00:00 2001 From: James Ide Date: Sun, 27 Sep 2015 23:46:00 -0700 Subject: [PATCH] Explanation of Modal's purpose in hybrid apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Explained that Modal is for hybrid apps and suggest using a top-level Navigator in pure RN apps. Closes https://github.com/facebook/react-native/pull/2663 Reviewed By: @​svcscm Differential Revision: D2483626 Pulled By: @sahrens --- Libraries/Modal/Modal.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 8e3a88665..1124b904a 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -19,6 +19,18 @@ var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); var RCTModalHostView = requireNativeComponent('RCTModalHostView', null); +/** + * A Modal component covers the native view (e.g. UIViewController, Activity) + * that contains the React Native root. + * + * Use Modal in hybrid apps that embed React Native; Modal allows the portion of + * your app written in React Native to present content above the enclosing + * native view hierarchy. + * + * In apps written with React Native from the root view down, you should use + * Navigator instead of Modal. With a top-level Navigator, you have more control + * over how to present the modal scene over the rest of your app. + */ class Modal extends React.Component { render(): ?ReactElement { if (this.props.visible === false) {