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

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

На главную

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

106,589 просмотров • 3 лет назад •via X (Twitter)

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

Фото профиля Seb ⚛️ ThisWeekInReact.com
Seb ⚛️ ThisWeekInReact.com3 лет назад

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

Фото профиля Matt Pocock
Matt Pocock3 лет назад

Nice!

Фото профиля Chris Ribeiro
Chris Ribeiro3 лет назад

Is it work with forwardRef?

Фото профиля Sadman Sakib
Sadman Sakib3 лет назад

you can also create type for framer motion div this way

Фото профиля Sidi jeddou
Sidi jeddou3 лет назад

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

Фото профиля nexxel
nexxel3 лет назад

wow this is so helpful

Фото профиля Marcos S. 🇵🇸 | tpicj index.js
Marcos S. 🇵🇸 | tpicj index.js3 лет назад

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

Фото профиля guido scialfa
guido scialfa3 лет назад

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

Фото профиля scarletczen🌃
scarletczen🌃3 лет назад

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

Фото профиля Josh Claunch
Josh Claunch3 лет назад

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 😄

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