mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-13 09:20:15 +08:00
Add sub-reducer support to NavigationStackReducer
Summary: Revise APIs of reducers, and ensure the stack reducer can support sub-reducers Reviewed By: javache Differential Revision: D2959915 fb-gh-sync-id: 20b28b9ead7ace3373489a806486999048d32aef shipit-source-id: 20b28b9ead7ace3373489a806486999048d32aef
This commit is contained in:
committed by
facebook-github-bot-6
parent
876ecb291f
commit
dcb68db758
@@ -28,7 +28,7 @@
|
||||
'use strict';
|
||||
|
||||
const Animated = require('Animated');
|
||||
const NavigationReducer = require('NavigationReducer');
|
||||
const NavigationRootContainer = require('NavigationRootContainer');
|
||||
const NavigationContainer = require('NavigationContainer');
|
||||
const PanResponder = require('PanResponder');
|
||||
const Platform = require('Platform');
|
||||
@@ -95,7 +95,7 @@ class NavigationCard extends React.Component {
|
||||
const doesPop = (xRatio + vx) > 0.45;
|
||||
if (doesPop) {
|
||||
// todo: add an action which accepts velocity of the pop action/gesture, which is caught and used by NavigationAnimatedView
|
||||
this.props.onNavigate(NavigationReducer.StackReducer.PopAction());
|
||||
this.props.onNavigate(NavigationRootContainer.getBackAction());
|
||||
return;
|
||||
}
|
||||
Animated.spring(this.props.position, {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const Animated = require('Animated');
|
||||
const Image = require('Image');
|
||||
const NavigationContainer = require('NavigationContainer');
|
||||
const NavigationReducer = require('NavigationReducer');
|
||||
const NavigationRootContainer = require('NavigationRootContainer');
|
||||
const React = require('react-native');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
const Text = require('Text');
|
||||
@@ -103,7 +103,7 @@ class NavigationHeader extends React.Component {
|
||||
);
|
||||
}
|
||||
_handleBackPress() {
|
||||
this.props.onNavigate(NavigationReducer.StackReducer.PopAction());
|
||||
this.props.onNavigate(NavigationRootContainer.getBackAction());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user