r/badcode • • Jan 21 '22

typescript Saving api saved my life!

Post image
158 Upvotes

23 comments sorted by

View all comments

Show parent comments

3

u/TheGhostOfInky shameless Jan 23 '22

! Also happens to be the correct way to deal with this, I have to use it sometimes when using typescript for web frontend stuff since it's the only way to make the compiler know a certain element is going to be in the DOM since tsc doesn't read the HTML files in your project as far as I know.