Describe the bug
const [thing, setThing] = makePersisted(createSignal("hello"), {
name: "thing",
storage: localStorage,
});
> tsc --noEmit
src/App.tsx(8,43): error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'Signal<string>' is not assignable to parameter of type 'Signal<unknown> | [unknown, SetStoreFunction<unknown>]'.
Type '[get: Accessor<string>, set: Setter<string>]' is not assignable to type 'Signal<unknown>'.
Type at position 1 in source is not compatible with type at position 1 in target.
Type 'Setter<string>' is not assignable to type 'Setter<unknown>'.
Target signature provides too few arguments. Expected 1 or more, but got 0.
Currently, the only way to fix it seems to be to provide full, explicit types:
const [thing, setThing] = makePersisted<string, Signal<string>>(createSignal("hello"), {
name: "thing",
storage: localStorage,
});
Minimal Reproduction Link
https://stackblitz.com/edit/github-ojctyhmm
Describe the bug
Currently, the only way to fix it seems to be to provide full, explicit types:
Minimal Reproduction Link
https://stackblitz.com/edit/github-ojctyhmm