1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Files
tooot/src/utils/getCurrentTab.ts
2020-12-07 12:31:40 +01:00

9 lines
303 B
TypeScript

const getCurrentTab = (navigation: any) => {
const { length, [length - 1]: last } =
navigation.dangerouslyGetState().history ||
navigation.dangerouslyGetParent()?.dangerouslyGetState().history
return `Screen-${last.key.split(new RegExp(/Screen-(.*?)-/))[1]}`
}
export default getCurrentTab