Compare commits

..

3 Commits

Author SHA1 Message Date
Brent Vatne
eb78128439 Release 1.5.3 2018-03-14 11:16:19 -07:00
Brent Vatne
c39ec7a10c Use arrow function instead of bind 2018-03-14 11:16:01 -07:00
Chris
0ff3347e97 Update CardStack.js (#3749)
fix for https://github.com/react-navigation/react-navigation/issues/3729 , https://github.com/react-navigation/react-navigation/issues/3746
2018-03-14 11:08:26 -07:00
3 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-navigation", "name": "react-navigation",
"version": "1.5.2", "version": "1.5.3",
"description": "Routing and navigation for your React Native apps", "description": "Routing and navigation for your React Native apps",
"main": "src/react-navigation.js", "main": "src/react-navigation.js",
"repository": { "repository": {

View File

@@ -110,7 +110,7 @@ class CardStack extends React.Component {
} }
_isRouteFocused = route => { _isRouteFocused = route => {
const { state } = this.props.navigation; const { transitionProps: { navigation: { state } } } = this.props;
const focusedRoute = state.routes[state.index]; const focusedRoute = state.routes[state.index];
return route === focusedRoute; return route === focusedRoute;
}; };
@@ -129,7 +129,7 @@ class CardStack extends React.Component {
const screenNavigation = addNavigationHelpers({ const screenNavigation = addNavigationHelpers({
dispatch: navigation.dispatch, dispatch: navigation.dispatch,
state: scene.route, state: scene.route,
isFocused: this._isRouteFocused.bind(this, scene.route), isFocused: () => this._isRouteFocused(scene.route),
addListener: this._childEventSubscribers[scene.route.key], addListener: this._childEventSubscribers[scene.route.key],
}); });
screenDetails = { screenDetails = {

View File

@@ -108,7 +108,7 @@ export default class DrawerView extends React.PureComponent {
this._screenNavigationProp = addNavigationHelpers({ this._screenNavigationProp = addNavigationHelpers({
dispatch: navigation.dispatch, dispatch: navigation.dispatch,
state: navigationState, state: navigationState,
isFocused: this._isRouteFocused.bind(this, navigationState), isFocused: () => this._isRouteFocused(navigationState),
addListener: this._childEventSubscribers[navigationState.key], addListener: this._childEventSubscribers[navigationState.key],
}); });
}; };