mirror of https://github.com/tooot-app/app
9 lines
303 B
TypeScript
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
|