In our project, we are using react-navigation v6 for routing, but we are planning to migrate to expo-router. Before that, we have a problem that needs to be resolved.
In our app, we have a routing configuration that has optional path params
http://localhost/63317906914dea717e1b71a0 We are adding this conditionally when Configuring the links. we are doing this because there are some instances our app is running on a custom domain http://localhost in that case we are no longer required to add path params if it’s not in a custom domain to identify the business we are using this Id.
If further clarification is needed, the localhost can be accessed at either http://{ourdomain}/63317906914dea717e1b71a0
or http://{customdomain}/
In our linking config we do something like this to add this domain capability
name: 'Root',
initialRouteName: 'Home',
path:
__dev__ ||
(__web__ && window?.location.origin.includes('{ourdomain}.com'))
? '/:Id?'
: '',
Since the expo router is file-based routing how do we configure something like this. do I need to create two separate files on the root level to achieve this?