mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
Fix isFocused from withNavigationFocus is a function (#3710)
Fixes #3709
This commit is contained in:
committed by
Satyajit Sahoo
parent
3bfb0b90d0
commit
1d573bc246
@@ -31,7 +31,7 @@ export default function withCachedChildNavigation(Comp) {
|
||||
});
|
||||
}
|
||||
|
||||
_isRouteFocused = route => () => {
|
||||
_isRouteFocused = route => {
|
||||
const { state } = this.props.navigation;
|
||||
const focusedRoute = state.routes[state.index];
|
||||
return route === focusedRoute;
|
||||
@@ -58,7 +58,7 @@ export default function withCachedChildNavigation(Comp) {
|
||||
this._childNavigationProps[route.key] = addNavigationHelpers({
|
||||
dispatch: navigation.dispatch,
|
||||
state: route,
|
||||
isFocused: this._isRouteFocused.bind(this, route),
|
||||
isFocused: () => this._isRouteFocused(route),
|
||||
addListener: this._childEventSubscribers[route.key],
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user