High Definition Standard Definition Theater
Video id : x3_eoT-nQek
ImmersiveAmbientModecolor: #adb3b0 (color 2)
Video Format : (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: 140 ( High )
PokeTubeEncryptID: 50cbcd403673f3cf2e604b4754cad85b8670a9c1c133817ea8d617402c90adf4949be88996fbbf514575eea3307de5e7
Proxy : iv.ggtyler.dev - refresh the page to change the proxy location
Date : 1726916830886 - unknown on Apple WebKit
Mystery text : eDNfZW9ULW5RZWsgaSAgbG92ICB1IGl2LmdndHlsZXIuZGV2
143 : true
I Wish I knew this about React Props and Typescript Sooner
Jump to Connections
78,610 Views • Dec 28, 2023 • Click to toggle off description
Metadata And Engagement

Views : 78,610
Genre:
Uploaded At Dec 28, 2023 ^^


warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.915 (72/3,300 LTDR)

97.86% of the users lieked the video!!
2.14% of the users dislieked the video!!
User score: 96.79- Overwhelmingly Positive

RYD date created : 2024-08-27T17:04:45.894482Z
See in json
Tags
Connections
Nyo connections found on the description ;_; report an issue lol

YouTube Comments - 55 Comments

Top Comments of this video!! :3

@reactdom.render

8 months ago

💡Tips:

You can use PropsWithChildren which type is import directly from React instead of declaring type for children prop

6 |

@shivangrathore

8 months ago

I use ComponentProps more

23 |

@mtsoul9834

8 months ago

what software that you use to record it. I saw the red line. it's so useful

1 |

@pietro_dev_07

8 months ago

What vscode theme do you use in this video? Thanks!

|

@Kv-kk2nj

8 months ago

But we can use state management tool right then why props?

|

@jordanking3946

7 months ago

What theme are you using?

|

@ucanh5104

8 months ago

what kinda font are u using brother?

|

@mcsoud

8 months ago

Dude, children should be a ReactNode and if you are using vs code you.could just hover over the div to take the exact div props react provides you if you don't want to use the typeof componentProps

1 |

@amranimohamad4741

8 months ago

The approach you've chosen doesn't satisfy all component capabilities cause when will want to include a "title" prop it must be passed by an interface or a type alies that why it's better to have the interface related to the component extend all the attributes besides the necessary ones .

4 |

@Thassalocracy

8 months ago

I think a really nice thing about react types now is it's not even necessary to either extend from React.HTMLAttributes or React.FC for almost all components. The types already infer the HTML element correctly the moment we return it.

Now the only thing that we must explicitly define is the "children" prop, if we are using it for the component. Even that is super easy, just couple children with React.ReactNode.

3 |

@gubatenkov

8 months ago

There is a better type helper for this purposes built in React called ComponentProps

1 |

@pep3marquez46

8 months ago

Yes, it's. Why declare all the properties that you are supposed to only use, when you can extend from an interface that brings all the types that you will need, and the that in the future you may need 👍

5 |

@imbrijesh

8 months ago

Which theme?

|

@dilshadmatkulov3318

8 months ago

what is the point of using any in Typescript?

|

@shapelessed

8 months ago

Great, but why would anyone lose their sanity on React?

2 |

@v-dubcurrency6212

8 months ago

ComponentProps<'div'>

1 |

@Solo_playz

8 months ago

Which theme bro? It's cool please let me know

|

@kamgdy89

8 months ago

ComponentProps!!!

1 |

@dinoscheidt

8 months ago

With this “trick” he just canceled his ts docs which are i.e. rendered in storybook. If you want to use react with typescript properly, type react and typescript into a search engine and look at the cheat sheets; not at influencers. Here i.e. instead of creating the interface from a react primitive. Do not couple to react Dom - breaking other renderers like native and server. This also makes the interface totally unusable in other contexts and components. Instead extend on the functional component using its generics i.e. React.FC<CardProps>.

28 |

Go To Top