router
router copied to clipboard
The current version of react-location published to npm isn't compatible with TypeScript 4.8
Describe the bug
When I'm running typecheck in TS 4.8 in my repo, TS throws those type errors:
node_modules/@tanstack/react-location/build/types/index.d.ts(51,34): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(52,39): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(53,41): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(54,23): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(55,27): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(57,34): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(57,88): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(58,39): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(59,23): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(61,65): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(61,101): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(97,19): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(103,41): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(104,46): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(105,48): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(112,24): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(117,25): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(127,67): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(168,62): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(168,89): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(170,24): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(171,25): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(198,23): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(296,41): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(297,46): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(298,48): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
node_modules/@tanstack/react-location/build/types/index.d.ts(329,69): error TS2344: Type 'TGenerics' does not satisfy the constraint 'Partial<DefaultGenerics>'.
Your Example Website or App
N/A
Steps to Reproduce the Bug or Issue
Run typecheck on react-location with TS upgraded to TS 4.8
Expected behavior
react-location's generic should be adapted to TS 4.8+
Screenshots or Videos
No response
Platform
- OS: macOS
- Version: react-location v3.7.4 (latest on npm)
Additional context
I can work on a fix if react-location still accepts PRs / fixes
Edit: I see that this was fixed in https://github.com/TanStack/router/pull/342. Do you know if there is a plan to release it to the current @tanstack/react-location?
I would accept a PR to backport it.
I would accept a PR to backport it.
I may be wrong, but I think that https://github.com/TanStack/router/pull/342 already includes the fix for TS 4.8 and already targets react-location so it should already be backported (but not deployed to npm)
If that's the case, I'm not sure what other PR i could do. Otherwise, I'm down to create a PR for it, I'm just not sure what needs to be done.
Thank you in advance!
@tannerlinsley what would be the process to backport it / to deploy the current main branch to npm? (the main branch seems to include the TS 4.8 patch: https://github.com/TanStack/router/tree/main/packages/react-location/src)