Files
discord-decomp/modules/app_launcher/native/hooks/useNavigationTransitionEnded.tsx
T
2026-11-01 12:12:55 +02:00

17 lines
680 B
TypeScript

// Metro module 11302 (f11303).
import { useState, useEffect } from "react";
import { useAppLauncherNavigation } from "../AppLauncherNativeConstants";
import { useRoute } from "../../../../_bundle/Module1481";
export default function useNavigationTransitionEnded() {
const [state, setState] = useState(false);
const appLauncherNavigation = useAppLauncherNavigation();
const route = useRoute();
useEffect(() => appLauncherNavigation.addListener("transitionEnd", () => {
const state = appLauncherNavigation.getState();
if (state.routes[state.index].key === route.key) {
setState(true);
}
}), [appLauncherNavigation, route, setState]);
return state;
};