mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-12 17:30:12 +08:00
Navigation Back support and examples for Android
Summary: public - Intro new back action - Add support in the two main reducers - Use it in examples to support Android back button - Disable NavigationCard gestures on Android Reviewed By: hedgerwang Differential Revision: D2914154 fb-gh-sync-id: d4dce6538e19613a2ffca21e2e3b2ecaded3d5dc shipit-source-id: d4dce6538e19613a2ffca21e2e3b2ecaded3d5dc
This commit is contained in:
committed by
facebook-github-bot-5
parent
7b57b5c84a
commit
7b2b0c3c1c
@@ -40,6 +40,7 @@ const NavigationBasicExample = React.createClass({
|
||||
<NavigationRootContainer
|
||||
reducer={NavigationBasicReducer}
|
||||
persistenceKey="NavigationBasicExampleState"
|
||||
ref={navRootContainer => { this.navRootContainer = navRootContainer; }}
|
||||
renderNavigation={(navState, onNavigate) => {
|
||||
if (!navState) { return null; }
|
||||
return (
|
||||
@@ -69,6 +70,14 @@ const NavigationBasicExample = React.createClass({
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
handleBackAction: function() {
|
||||
return (
|
||||
this.navRootContainer &&
|
||||
this.navRootContainer.handleNavigation(NavigationRootContainer.getBackAction())
|
||||
);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
Reference in New Issue
Block a user