SolidJSS
SolidJSโ€ข2y agoโ€ข
6 replies
gsoutz

Cant set signal from getting another signal typescript error

function update<T>(target: Accessor<T | undefined>) {

  let [current, set_current] = createSignal<T | undefined>(undefined)

  set_current(target())
}


No overload matches this call.
  The last overload gave the following error.
    Argument of type 'T | undefined' is not assignable to parameter of type 'Exclude<T, Function> | ((prev: T | undefined) => T | undefined) | undefined'.
      Type 'T' is not assignable to type 'Exclude<T, Function> | ((prev: T | undefined) => T | undefined) | undefined'.(2769)
signal.d.ts(109, 3): The last overload is declared here.
(parameter) target: () => T | undefined


https://playground.solidjs.com/anonymous/3218adfe-fd03-4d61-9763-02637001ca22
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?