// Defer heavy render to next frame to avoid nav jank
const [ready, setReady] = React.useState(false);
React.useEffect(() => {
const task = InteractionManager.runAfterInteractions(() => {
// Small timeout so the indicator is visible when transition is very fast
const t = setTimeout(() => setReady(true), 50);
return () => clearTimeout(t);
});
return () => task.cancel();
}, []);
solution grabbed from chatgpt5