Тёмный

React TypeScript Tutorial - 5 - Advanced Props 

Codevolution
Подписаться 648 тыс.
Просмотров 149 тыс.
50% 1

📘 Courses - learn.codevolution.dev/
⚡️ Checkout Taskade! www.taskade.com/
💖 Support UPI - support.codevolution.dev/
💖 Support PayPal - www.paypal.me/Codevolution
💾 Github - github.com/gopinav
📱 Follow Codevolution
+ Twitter - / codevolutionweb
+ Facebook - / codevolutionweb
📫 Business - codevolution.business@gmail.com
Advanced Prop Types with React and TypeScript

Опубликовано:

 

6 сен 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 57   
@Codevolution
@Codevolution 2 года назад
Use coupon code CodevolutionRU-vid for 100% off lifetime discount to your subscription at www.taskade.com/billing
@srshah
@srshah 10 месяцев назад
I know it is pretty late but the coupon code is giving 10% off not 100%. I wish it gave 100% :)
@phantomknight287
@phantomknight287 2 года назад
Superb Video, No rubbish, No clickbait just Pure Content, Thanks for Teaching me React and Nextjs.
@shehzadhussain01
@shehzadhussain01 Год назад
React with Typescript
@Wibu393
@Wibu393 18 часов назад
Perfect Course ! your voice so clear and very easy to understand. thanks
@faisalzone
@faisalzone Год назад
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.
@ajayagrawal1090
@ajayagrawal1090 2 года назад
VIshwas you are incredible!!!!. You present the content really well and planned in each step.
@endthefed5304
@endthefed5304 Год назад
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 = (props) => {}; // props includes children and name properties
@ishanihewage3734
@ishanihewage3734 2 года назад
Waiting for the next video on React TypeScript Tutorial. These were amazing well explained and thanks for doing this.
@YuriiKratser
@YuriiKratser 2 года назад
Don't stop bro! Nowadays is a mainstream! Thanks
@user-lq1ku9he6c
@user-lq1ku9he6c 10 месяцев назад
Your guide is very easy to understand. Thanks so much
@Prasanth_Venkatachalam
@Prasanth_Venkatachalam 2 года назад
Thank you very much. It's Very Useful to develop React Apps. Your voice is just amazing
@joybee210
@joybee210 2 года назад
awesome, I learned a lot. thanks!
@angeleskidragan
@angeleskidragan Год назад
Thank you for the great videos!
@zainuddin1205
@zainuddin1205 2 года назад
This is great content...Thank you
@ArjunRaj-xn8es
@ArjunRaj-xn8es 2 года назад
Superb videos 🙏🏼
@matthiasfendt4503
@matthiasfendt4503 Месяц назад
Great tutorial but for the status type I would recommend using an enum instead of union of string literals.
@A03L
@A03L Год назад
its true when they said typescript is superior, fascinating!
@davidschreiter1483
@davidschreiter1483 8 месяцев назад
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
@kenhan168
@kenhan168 Год назад
So good, thanks a lot!
@rahulvashishth8551
@rahulvashishth8551 2 года назад
i would recommend to have other payment methods for support. i.e. upi, patron. many people don't use paypal.
@worstenbroodje6832
@worstenbroodje6832 Год назад
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.
@uzDevWorkshop
@uzDevWorkshop Год назад
this is object destructuring
@jibinkoshy2739
@jibinkoshy2739 2 года назад
Thanks
@milindnaik8115
@milindnaik8115 2 года назад
Amazing
@wizardy6267
@wizardy6267 2 года назад
Thanks for this tutorial. One questin for the status example, why not use enum?
@Codevolution
@Codevolution 2 года назад
Literals are easier
@timacorn2536
@timacorn2536 Год назад
Quick question, in app.tsx, how does Status only have this: but heading and oscar have ...... and ....?
@Shakas420
@Shakas420 2 года назад
Awesome!
@vilayatsafarov9214
@vilayatsafarov9214 Год назад
That is awesome...
@Temp-pn4lm
@Temp-pn4lm 2 месяца назад
I like how the strategy is to write normal react code and then do smth to fix the errros
@zakirbangash3185
@zakirbangash3185 2 года назад
Kinldy don't forget to make tutorial on Redux toolkit with typescript
@rlm41
@rlm41 Год назад
For the children props part. Why does it work when you are not using the text as a prop of for example, instead of
@AboudASalam
@AboudASalam 10 месяцев назад
Children prop is meant for passing data within the component tag , mainly to render other components as children
@yash8904
@yash8904 11 месяцев назад
Doubt: When I do this and the output in the ui is coming directly from the Heading component and not from Heading component being passed to Parent component as prop (---{props.children}---which is heading component in this case) UNDER PARENT COMPONENT Is it supposed to be that way or am I missing something in the concept?
@genos2719
@genos2719 2 года назад
amazing
@ashishnayak2666
@ashishnayak2666 2 года назад
Best video
@AndriusLau
@AndriusLau 2 года назад
And what about JSX.Element instead of ReactNode: interface OscarProps { children: JSX.Element } export const Oscar: React.FC = (props) => { return {props.children} };
@tadurirk
@tadurirk 2 года назад
Awesome
@kulansky2002
@kulansky2002 2 года назад
is that example of children component props still available? Got some errors
@kulansky2002
@kulansky2002 2 года назад
nvm it was my bad, thanks a lot for clear tutorials greetings from PL
@mayureshkumar3717
@mayureshkumar3717 3 месяца назад
const { message=0} = props not working. for an optional value its giving unefined in a TS online compiler
@paschalokafor9043
@paschalokafor9043 Год назад
You can also use propsWithChildren generic type for children
@timacorn2536
@timacorn2536 Год назад
Can someone explain why 'children' was used in the HeadingProps? Seemed to come out of nowhere
@asifuzzamanbappy1297
@asifuzzamanbappy1297 Год назад
passing children as a prop is a thing in react....
@NoumanKhan-ck7vx
@NoumanKhan-ck7vx 2 года назад
instead of this type Childerns = { children: React.ReactNode; }; even if i do type Childerns = { children: any; }; why it is still working both are same ?? (7:04 vedio length)
@chesterxp508
@chesterxp508 Год назад
GoodJob!
@mrrishiraj88
@mrrishiraj88 2 года назад
🙏👍
@dand4485
@dand4485 2 года назад
Great course so far. Not sure if others are running into issues when updating the Greet component to default to zero upon updating to make it optional? Not sure if it is the best way, but got around it with doing this: const Greet = (props:GreetProps) => { let mCount if( props.msgCount === undefined) { mCount = 0; } /* The rest of the code... */ When trying to de-structure as the current video shows: const {msgCount=0} = props.msgCount; I'm getting an error something like: Property 'msgCount' does not exist on type 'number | undefined'. FYI . "typescript": "^4.1.2", I'm assuming my typescript is the latest i just installed today fresh, didn't specify a version so i'm assuming i'm on the latest? Also to be complete did try: npm install -g typescript@latest no change :( Just in case others run into the same issue. You can use my old fashion tried and and true way :)
@scott-johnston
@scott-johnston 2 года назад
I had the same issue, but realised I forgot to change my JSX and remove "props." from the ${props.messageCount}. When I made the change I now correctly get 0 unread messages instead of undefined unread messages. It's in the video, I just missed it. So the line should now read: ? `Welcome ${props.name}! You have ${messageCount} unread messages`
@MyALPHAguy
@MyALPHAguy Год назад
Status not working... why?
@ragibshahariarayon7975
@ragibshahariarayon7975 Год назад
if the error is: Variable is used before being assigned (TypeScript) then use: let message: string = "";
@MohammedAlziko
@MohammedAlziko 4 месяца назад
❣❣❣💯💯💯
@irotv7584
@irotv7584 Год назад
You sound like freeze youtuber, am I wrong ?
@Bradcopo
@Bradcopo 2 года назад
😋😋
@sulochanakharat9033
@sulochanakharat9033 2 года назад
Sir are you Indian ?? If yes please make vedio in hindi 🙏🙏🙏
@VigneshwaranChandrasekaranA
@VigneshwaranChandrasekaranA 2 года назад
Learn English