Загрузка видео...

Не удалось загрузить видео

На главную

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

77,657 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 12

Фото профиля George Moller
George Moller2 лет назад

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 ↓

Фото профиля Pavel Romanov
Pavel Romanov2 лет назад

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

Фото профиля George Moller
George Moller2 лет назад

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

Фото профиля Web-Dev-Codi
Web-Dev-Codi2 лет назад

Typescript version ohhhh yeah. Nice 👍

Фото профиля George Moller
George Moller2 лет назад

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

Фото профиля Shripal Soni
Shripal Soni2 лет назад

Loved this tip 🤩

Фото профиля George Moller
George Moller2 лет назад

Glad you liked it Shripal!

Фото профиля NORMAL
NORMAL2 лет назад

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

Фото профиля freddie
freddie2 лет назад

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

Фото профиля P4R4NO1D73
P4R4NO1D732 лет назад

what tool do you use for animation ?

Фото профиля satonin
satonin2 лет назад

Wtf 🥴

Фото профиля Parth Prajapati
Parth Prajapati2 лет назад

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

Похожие видео