DEV Community

Discussion on: Typescript - Tips & Tricks - Non-null assertion operator

Collapse
 
jackmellis profile image
Jack

Yes I do this but often the combinations are so complex it becomes impractical and often typescript is left unable to correctly infer which variation you're referring to. This is especially true when you're passing an object around several different functions or if you're using assertions that are out of your control that also don't offer sufficient type guarding.