DEV Community

Discussion on: React + Typescript === "headache"

Collapse
 
ecyrbe profile image
ecyrbe

You should not add typings to things you get back from a function, (like useState), there is what is called type inference and you should use it extensively.
You usually only need to add typing to your input parameters if you use type inference correctly.

even in c++ now everybody uses type inference everywhere.

Collapse
 
vinicius77 profile image
Vinicius Cerqueira Bonifácio

Thanks for the hint!

I am going to be aware of type inference from now on. :)