Code is:
const foo = (foo: string) => { const result = [] result.push(foo) }
I get the following TS error:
[t
I got the same error in ReactJS function component, using ReactJS useState hook. The solution was to declare the type of useState at initialisation:
const [items , setItems] = useState([]); // replace IItem[] with your own typing: string, boolean...