HomeToolsAbout a20k

Common Errors

not assignable to parameter of type never

Error Message

not assignable to parameter of type never

const foo = (foo: string) => { const result = [] result.push(foo) }

Resolution

Without a type defined in array, it defaults to never. Assign type.

const result : string[] = [];
© VincentVanKoh