Why you need to assign types to variables while using typescript #shorts #typescript

preview_player
Показать описание
Join my channel to support me to continue doing what I love!

Creative Commons / Attribution 4.0 International (CC BY 4.0)
Рекомендации по теме
Комментарии
Автор

Isn't it better to define it as ref<HtmlDivElement>()?

Then it the type will be Ref<HtmlDivElement | undefined>

Woewal
Автор

I freakn hate type script :) tried to learn it 3 times back a few years ago got to the full basic part and can write it out but still don't like it. Yeah, it gives auto-complete and compile-time support but nah.

anujshrestha