Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

⚛️ React + Typescript tip: Creating dynamic prop types for components with Discriminated Unions ↓

77,657 Aufrufe • vor 2 Jahren •via X (Twitter)

12 Kommentare

Profilbild von George Moller
George Mollervor 2 Jahren

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 ↓

Profilbild von Pavel Romanov
Pavel Romanovvor 2 Jahren

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

Profilbild von George Moller
George Mollervor 2 Jahren

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

Profilbild von Web-Dev-Codi
Web-Dev-Codivor 2 Jahren

Typescript version ohhhh yeah. Nice 👍

Profilbild von George Moller
George Mollervor 2 Jahren

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

Profilbild von Shripal Soni
Shripal Sonivor 2 Jahren

Loved this tip 🤩

Profilbild von George Moller
George Mollervor 2 Jahren

Glad you liked it Shripal!

Profilbild von NORMAL
NORMALvor 2 Jahren

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

Profilbild von freddie
freddievor 2 Jahren

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

Profilbild von P4R4NO1D73
P4R4NO1D73vor 2 Jahren

what tool do you use for animation ?

Profilbild von satonin
satoninvor 2 Jahren

Wtf 🥴

Profilbild von Parth Prajapati
Parth Prajapativor 2 Jahren

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

Ähnliche Videos