Skip to content

Commit

Permalink
fix: fixed extracting navigation state for RN 4
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Jun 20, 2020
1 parent 36b55a7 commit f132e11
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/AnimatedTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,15 @@ export function AnimatedTabBar<T extends PresetEnum>(
key: string;
} = useMemo(() => {
if (isReactNavigation5) {
return {
index: state.index,
routes: state.routes,
key: state.key,
};
return state;
} else {
return {
index: navigation!.state.index,
routes: navigation!.state.routes,
key: '',
};
}
}, [state.index, state.routes, state.key, navigation, isReactNavigation5]);
}, [state, navigation, isReactNavigation5]);

const getRouteTitle = useCallback(
(route: Route) => {
Expand Down

0 comments on commit f132e11

Please sign in to comment.