Amy Blankenship
Jul 26, 2024

--

A lot of this comes down to trying to do too much manually and not letting TS do the work for you. For example, your last example could be more like

const greet - (value: string | number) => {

// logic returning string

}

type GreetFunction = typeof greet //if you still need a specific type here

In the end, the utility of TS comes down to the experience and interest of the coders, and no project of less than 18 months should implement TS unless the developers are 100% committed or already know how to use TS well.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

No responses yet