Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[router]: change Href to not be generic / use expo-router package for…
… tests (#27690) # Why There PR is multiple fixes for typed routes 1. Generate the test fixtures using the same typed-route utility functions exported by Expo Router Expo Router now provides the utility functions to generate the `.d.ts` file used for typed routes. This PR changes the `@expo/cli` tests to generate the fixture file using these functions. 2. Change `Href<T>` to `Href` I've personally had some issues with using custom components wrapped in `fowardRef` that use `Href` for a prop. `forwardRef` doesn't work well with generic components, so I've refactored the types so `Href` is no longer generic. Not only does this fix this issue, it improves the editor autocomplete when inferring the `Href` value. 3. Enable `/(groups)/` in typed routes. Technically they were always allowed, but partial routes are allowed. For example you can do `/(group1)/(group2)/page` or simply `/(group1)/page` or even just `/page`. 4. Added a new set of tests to ensure that `Href` can be assigned to as expected. With the changes to `Href` I've added new set to tests to ensure users can assign values to `Href` as expected. # How <!-- How did you build this feature or fix this bug and why? --> # 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