Screen Loading
Measure how long each React Native screen takes to become interactive with TTID and optional TTFL, using the automatic navigator hook or the manual flow.
Screen Loading measures how long each screen takes to become interactive (TTID) and, optionally, fully loaded (TTFL). It supports an automatic flow that hooks into your navigator and a manual flow for custom or data-driven screens.
Enabling the feature
Make sure the SDK is initialized and use the below API to enable screen loading for your React Native app
import { APM } from '@luciq/react-native';
APM.setScreenLoadingEnabled(true);Automatic (React Navigation v6)
Tracks every navigation transition without per-screen code.
Create a NavigationContainerRef and wire both the listener and onStateChange:
import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native';
import Luciq from '@luciq/react-native';
export default function App() {
const navigationRef = useNavigationContainerRef();
useEffect(() => {
Luciq.setNavigationListener(navigationRef);
}, [navigationRef]);
return (
<NavigationContainer ref={navigationRef} onStateChange={Luciq.onStateChange}>
{/* ... */}
</NavigationContainer>
);
}setNavigationListenerstarts the span on navigation dispatch.onStateChangeends the span when the new route is committed.
Excluding Routes
To opt specific screens out of automatic measurement:
Manual Approach (Component wrapper LuciqCaptureScreenLoading)
Use this when you do not use a supported navigator, render screens conditionally, or need a precise "screen is ready" signal that includes async data.
The span starts at component construction and ends after first layout (TTID).
Pass
record={false}to skip measurement on a specific render. Nested wrappers are auto-ignored.
Extend the active trace until data is ready (TTFL)
Disabling/Enabling Screen Loading
Last updated