diff --git a/src/CollapsibleTabView.tsx b/src/CollapsibleTabView.tsx index e384c0cb..721e9db5 100644 --- a/src/CollapsibleTabView.tsx +++ b/src/CollapsibleTabView.tsx @@ -82,6 +82,11 @@ export type Props = Partial> & * 0 and 1. Default is 0.5. */ snapThreshold?: number; + /** + * The property from the `routes` map to use for the active route key + * Default is 'key' + */ + routeKeyProp?: keyof Extract; }; /** @@ -101,6 +106,7 @@ const CollapsibleTabView = ({ renderTabBar: customRenderTabBar, onHeaderHeightChange, snapThreshold = 0.5, + routeKeyProp = 'key', ...tabViewProps }: React.PropsWithoutRef>): React.ReactElement => { const [headerHeight, setHeaderHeight] = React.useState(initialHeaderHeight); @@ -289,7 +295,7 @@ const CollapsibleTabView = ({ return (