Skip to content

Commit

Permalink
fixup! feat: allow overriding route key property
Browse files Browse the repository at this point in the history
  • Loading branch information
andreialecu committed Nov 30, 2020
1 parent a6a4b52 commit 0ed7bf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CollapsibleTabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ const CollapsibleTabView = <T extends Route>({

React.useEffect(() => {
scrollY.addListener(({ value }) => {
const curRoute = routes[index].key;
const curRoute = routes[index][routeKeyProp as keyof Route] as string;
listOffset.current[curRoute] = value;
});
return () => {
scrollY.removeAllListeners();
};
}, [routes, index, scrollY]);
}, [routes, index, scrollY, routeKeyProp]);

/**
* Sync the scroll of unfocused routes to the current focused route,
Expand Down

0 comments on commit 0ed7bf0

Please sign in to comment.