Interview frequency: …
Short answer
Configure a linking object in NavigationContainer with the prefixes (scheme and web domain), and map URL patterns to screen routes and parameters.
Explanation
Deep links let users tap a URL such as https://myapp.com/products/42 or myapp://products/42 so the system opens the app and navigates directly to the specified product screen. Configuration includes Universal Links (iOS) and App Links (Android) using the apple-app-site-association and assetlinks.json files.
Code example
const linking = {
prefixes: ['myapp://', 'https://myapp.com'],
config: {
screens: {
MainTabs: {
screens: {
Feed: 'feed',
},
},
Details: 'product/:id',
},
},
};
<NavigationContainer linking={linking} fallback={<LoadingSpinner />}>
<RootNavigator />
</NavigationContainer>;Common mistakes
- Forgetting fallback handling for invalid deep-link routes, which can crash the app when a link has incorrect parameters.