Video yükleniyor...
Video Yüklenemedi
⚛️ React + Typescript tip: Creating dynamic prop types for components with Discriminated Unions ↓
77,657 görüntüleme • 2 yıl önce •via X (Twitter)
12 Yorum

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and 70+ video tutorials just like this one. Check them out ↓

One of the best react + typescript tips. It makes the overall code flow so much easier and enforce specific rules whenever needed.

I agree, this is such a common use case for React developers! it's great to have a way to type it.

Typescript version ohhhh yeah. Nice 👍

oh yeah, typescript + react tips are coming my friend!

Loved this tip 🤩

Glad you liked it Shripal!

Where’s the discrimination here ? Dang libs 🇺🇸 🍺

a good idea is to keep all members of the union with the same keys, but set the ones that aren’t supposed to be there as *optional never*. this will help you when writing the body of the component without needing to check for the existence of properties

what tool do you use for animation ?

Wtf 🥴

A super tip! Really cannot imagine working in React + TS without this.

