DEV Community

Discussion on: Testing a simple component with React Testing Library

Collapse
mbarzeev profile image
Matti Bar-Zeev Author

I hear ya.
I'm fairly new to TypeScript but not at all new to typed languages. I don't see declaring types as an optional choice. Either you're writing in a typed language or not. If you're using a typed language you should type anything which can be typed.
Nice simplification on the useRef() though ;)

Collapse
haaxor1689 profile image
Maroš Beťko • Edited on

Typescript should be a tool that helps you and not something that hinders you by wasting your time. Even languages like C++ now provide conveniences like auto type. By omitting some explicit types to let them be implicitly deduced or simplifying them you don't give up any type safety but save your time and make development faster.