I have tried writing the config object for my react native app according to the react-navigation configuring links docs.
I defined a series of path --> route mappings including Chat:'feed' and Explore:'news'
My goal is for the app to default to the Profile screen when resolving https://example.com/someusername and pass 'someusername' as the id param. Similar to how https://instagram.com/apple maps directly to the profile screen for @apple's account.
const linking = { prefixes: ['https://example.com', 'example://'], config: { Home: { path: '', screens: { Chat: 'feed', Explore: 'news', Profile: ':id', }, }, },}
I will not allow users to make accounts @feed, @news, etc. to avoid conflict. I also display "user not found" message if 'someusername' does not exist yet
Is there a correct way to do this config object? Or if I need to write custom getStateFromPath / getPathFromState functions, does anyone have an example?