I have some SolidJS code like:
{value() !== undefined && <img src={srcs[value()]} />}
where value
is a signal. I get a TypeScript error under value()
saying Type 'undefined' cannot be used as an index type.ts(2538)
What does this mean and how do I fix this without // @ts-ignore
?