React TypeScript Tutorial - 5 - Advanced Props

preview_player
Показать описание

📱 Follow Codevolution

Advanced Prop Types with React and TypeScript
Рекомендации по теме
Комментарии
Автор

Superb Video, No rubbish, No clickbait just Pure Content, Thanks for Teaching me React and Nextjs.

phantomknight
Автор

Great videos in the typescript playlist!! Thanks for your excellent teaching!
BTW, in 2022, children is no longer required as an explicit prop:

// The best way to properly type children is to use built-in type FC.
import { FC } from 'react';

// If the only prop you expect is children:
const MyComponent: FC = (props) => {}; // props includes only children property

// If you want to include more props than just children:
interface MyProps {
name: string;
}
const MyComponent: FC<MyProps> = (props) => {}; // props includes children and name properties

endthefed
Автор

These videos are so good! I'm a Python/Django developer who's moving to NextJS. And I found TypeScript to be one of the ideal ways to write code in NextJS. These videos are helping me learn just enough in-depth fundamentals of TypeScript.

faisalzone
Автор

Don't stop bro! Nowadays is a mainstream! Thanks

YuriiKratser
Автор

Your guide is very easy to understand. Thanks so much

SơnTrần-dp
Автор

Perfect Course ! your voice so clear and very easy to understand. thanks

Wibu
Автор

Waiting for the next video on React TypeScript Tutorial. These were amazing well explained and thanks for doing this.

ishanihewage
Автор

VIshwas you are incredible!!!!. You present the content really well and planned in each step.

ajayagrawal
Автор

Great tutorial but for the status type I would recommend using an enum instead of union of string literals.

matthiasfendt
Автор

its true when they said typescript is superior, fascinating!

AL
Автор

1. declaring possible props i.e specific strings @ 3:00
2. children: React.ReactNode for passing components as children @ 6:23
3. optional prop @ 8:11 ex. messageCount?: number
Overview: @9:18

davidschreiter
Автор

Thank you very much. It's Very Useful to develop React Apps.
Your voice is just amazing

Prasanth_Venkatachalam
Автор

i would recommend to have other payment methods for support. i.e. upi, patron. many people don't use paypal.

rahulvashishth
Автор

And what about JSX.Element instead of ReactNode:

interface OscarProps {
children: JSX.Element
}

export const Oscar: React.FC<OscarProps> = (props) => {

return <div>{props.children}</div>
};

AndriusLau
Автор

Can someone explain why 'children' was used in the HeadingProps? Seemed to come out of nowhere

timacorn
Автор

I like how the strategy is to write normal react code and then do smth to fix the errros

Temp-pnlm
Автор

Kinldy don't forget to make tutorial on Redux toolkit with typescript

zakirbangash
Автор

For the children props part. Why does it work when you are not using the text as a prop of <Heading> for example, instead of <Heading childrenprops="Placeholder text" you are doing <Heading>Placeholder text</Heading>

Because I see it works both ways, I'm wondering why?

rlm
Автор

const { message=0} = props not working. for an optional value its giving unefined in a TS online compiler

mayureshkumar
Автор

Great series so far this is really teaching me a lot! One question though, how does the syntax work when assigning a default value of 0 to messageCount at 8:37.
You set messageCount = 0 but when a prop is passed it takes the prop instead and you don't need to do props.messageCount anymore but just messageCount instead? I've never seen this before.

worstenbroodje