Skip to content

Instantly share code, notes, and snippets.

@emeraldsanto
Last active September 4, 2021 03:58
Show Gist options
  • Save emeraldsanto/4e7fe5ebbeec3760fe8f46803b894815 to your computer and use it in GitHub Desktop.
Save emeraldsanto/4e7fe5ebbeec3760fe8f46803b894815 to your computer and use it in GitHub Desktop.
Achieving type safe deep linking in React Native with react-navigation #11
import { LinkingOptions } from '@react-navigation/native';
const linking: LinkingOptions = {
prefixes: ['example://'],
config: {
screens: {
[RootStackConfiguration.name]: RootStackConfiguration.linking,
},
},
}
const TopLevelStack = createStackNavigator();
function App() {
return (
<NavigationContainer linking={linking}>
<TopLevelStack.Navigator>
<TopLevelStack.Screen
name={RootStackConfiguration.name}
component={RootStackConfiguration.render}
/>
{/* ... */}
</TopLevelStack.Navigator>
</NavigationContainer>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment