Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[router] fix initial url on web when using baseUrl (#27287)
# Why ENG-11108 When using a baseUrl on web after the initial load a `history.replace` event is fired which strips the baseUrl. This is caused by React Navigation examining the current URL (which has the baseURL) and the `url` attribute on the current focused route (which does not include the baseURL). As they are different, it assumes the URL is wrong and changes it via `history.replace`. # How I tried to fix this within the existing code, but eventually concluded that we simply need to fork `useLInking` for web as well. This fork simply removes the logic to use the URL on the state, and fall back to `getPathFromState` (which correctly handles baseUrl) # Test Plan <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
- Loading branch information