Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

React.ComponentProps is such a lifesaver, and more folks need to know about it.

106,589 görüntüleme • 3 yıl önce •via X (Twitter)

10 Yorum

Seb ⚛️ ThisWeekInReact.com profil fotoğrafı
Seb ⚛️ ThisWeekInReact.com3 yıl önce

😄 Basically impossible to work with React + TypeScript without this This is my most upvoted SO answer btw

Matt Pocock profil fotoğrafı
Matt Pocock3 yıl önce

Nice!

Chris Ribeiro profil fotoğrafı
Chris Ribeiro3 yıl önce

Is it work with forwardRef?

Sadman Sakib profil fotoğrafı
Sadman Sakib3 yıl önce

you can also create type for framer motion div this way

Sidi jeddou profil fotoğrafı
Sidi jeddou3 yıl önce

Wow wow I really didn’t know about this, thank you so much, Matt.

nexxel profil fotoğrafı
nexxel3 yıl önce

wow this is so helpful

Marcos S. 🇵🇸 | tpicj index.js profil fotoğrafı
Marcos S. 🇵🇸 | tpicj index.js3 yıl önce

`React.ComponentProps<typeof Component>`: exists. Me: `Parameters<typeof Component>[number]`. I just keep forgetting about it.

guido scialfa profil fotoğrafı
guido scialfa3 yıl önce

Thanks for sharing that. Most of the time we tend to write our own times when what we need is already there XD

scarletczen🌃 profil fotoğrafı
scarletczen🌃3 yıl önce

This is actually really good. I either write or use some library to get these props lol.

Josh Claunch profil fotoğrafı
Josh Claunch3 yıl önce

I've always wished we had a good naming convention for generic extractors like this. Doing <type-name><generic-name> like `ComponentProps` is too ... generic 😄

Benzer Videolar