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
{{ message }}
Repository navigation
useLinkedState infers unknown when derive reads previous with sourceEqual #1830
useLinkedState can infer its value as unknown when the derivation reads previous and sourceEqual is supplied, even though the callback returns a boolean. This reproduces against the 0.10.0 source at 082412f2410405651dcee0c4d077ddd056c26573 with TypeScript 5.9.3 in strict mode. It also reproduces importing the built runtime declaration directly, so it does not depend on the template compiler.
Expected: the inferred linked value and previous.value are boolean.
Observed: strict TypeScript reports the inferred value as unknown (TS2322); uses of previous or its inferred value can also report TS18046 or TS2345.
Workaround: explicitly annotate the derive callback's return type as boolean. It would help callers if the API signature could infer that return type without annotation while still typing previous. This is a declaration/inference issue, not an observed runtime failure.
Activity
fix(octane): infer useLinkedState's value when the reconciler declare…