DEV Community

Discussion on: The Trouble with TypeScript

Collapse
 
jwp profile image
John Peters

change your API or add another function call to get the compiler to work the way you want, I was understandably very uncooperative.

This statement makes little sense to me. Please explain.

Collapse
 
ryansolid profile image
Ryan Carniato

I linked an example in the Material UI docs but I also hit this a couple times in Solid with JSX type casting. Like look at createStyles in this documentation TypeScript with Material UI. This function call is necessary to make TypeScript work nicely even though it is essentially a no-op and pure runtime overhead.