You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update index.mdx
## Summary
This PR addresses a TypeScript error related to the use of readonly tuple types in conjunction with QRL.
## Problem
Using a readonly tuple type A extends readonly unknown[] caused the following TypeScript diagnostic when invoking a QRL:
Argument of type '[...A]' is not assignable to parameter of type 'QrlArgs<(...args: A) => R>'. [2345]
## Root Cause
This appears to be a type compatibility issue between the readonly tuple spread ([...A]) and the expected QrlArgs type in the QRL function signature. It's possible there's an edge case or mismatch in how QrlArgs<(...args: A) => R> resolves in the presence of readonly tuples, or perhaps recent TypeScript updates introduced stricter rules around readonly spreads.
## Solution
The fix involves removing the readonly modifier from the generic tuple constraint:
- A extends readonly unknown[]
+ A extends unknown[]
This ensures compatibility with the QRL's expected argument types while preserving type safety.
### Notes
Further investigation might be warranted to confirm whether this is a TypeScript typing nuance or a limitation in the Qwik QRL typings themselves.
0 commit comments