React TypeScript Tutorial - 5 - Advanced Props

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ค. 2024
  • 📘 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

ความคิดเห็น • 57

  • @Codevolution
    @Codevolution  2 ปีที่แล้ว +6

    Use coupon code CodevolutionTH-cam 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 ปีที่แล้ว +34

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

  • @Wibu393
    @Wibu393 4 วันที่ผ่านมา

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

  • @ajayagrawal1090
    @ajayagrawal1090 2 ปีที่แล้ว +1

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

  • @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.

  • @ishanihewage3734
    @ishanihewage3734 2 ปีที่แล้ว +2

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

  • @user-lq1ku9he6c
    @user-lq1ku9he6c 10 หลายเดือนก่อน +1

    Your guide is very easy to understand. Thanks so much

  • @YuriiKratser
    @YuriiKratser 2 ปีที่แล้ว +1

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

  • @Prasanth_Venkatachalam
    @Prasanth_Venkatachalam 2 ปีที่แล้ว

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

  • @endthefed5304
    @endthefed5304 ปีที่แล้ว +3

    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

  • @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 ปีที่แล้ว +1

    Superb videos 🙏🏼

  • @kenhan168
    @kenhan168 ปีที่แล้ว

    So good, thanks a lot!

  • @A03L
    @A03L ปีที่แล้ว

    its true when they said typescript is superior, fascinating!

  • @matthiasfendt4503
    @matthiasfendt4503 หลายเดือนก่อน

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

  • @milindnaik8115
    @milindnaik8115 2 ปีที่แล้ว +1

    Amazing

  • @Shakas420
    @Shakas420 2 ปีที่แล้ว

    Awesome!

  • @vilayatsafarov9214
    @vilayatsafarov9214 ปีที่แล้ว

    That is awesome...

  • @jibinkoshy2739
    @jibinkoshy2739 2 ปีที่แล้ว

    Thanks

  • @genos2719
    @genos2719 2 ปีที่แล้ว

    amazing

  • @rahulvashishth8551
    @rahulvashishth8551 2 ปีที่แล้ว +4

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

  • @tadurirk
    @tadurirk 2 ปีที่แล้ว

    Awesome

  • @ashishnayak2666
    @ashishnayak2666 2 ปีที่แล้ว

    Best video

  • @worstenbroodje6832
    @worstenbroodje6832 ปีที่แล้ว +1

    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

  • @chesterxp508
    @chesterxp508 ปีที่แล้ว

    GoodJob!

  • @zakirbangash3185
    @zakirbangash3185 2 ปีที่แล้ว +2

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

  • @wizardy6267
    @wizardy6267 2 ปีที่แล้ว

    Thanks for this tutorial. One questin for the status example, why not use enum?

  • @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?

  • @Temp-pn4lm
    @Temp-pn4lm 2 หลายเดือนก่อน

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

  • @timacorn2536
    @timacorn2536 ปีที่แล้ว

    Quick question, in app.tsx, how does Status only have this: but heading and oscar have ...... and ....?

  • @rlm41
    @rlm41 ปีที่แล้ว +1

    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

  • @kulansky2002
    @kulansky2002 2 ปีที่แล้ว +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

  • @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

  • @mayureshkumar3717
    @mayureshkumar3717 4 หลายเดือนก่อน

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

  • @AndriusLau
    @AndriusLau 2 ปีที่แล้ว +1

    And what about JSX.Element instead of ReactNode:
    interface OscarProps {
    children: JSX.Element
    }
    export const Oscar: React.FC = (props) => {
    return {props.children}
    };

  • @timacorn2536
    @timacorn2536 ปีที่แล้ว +1

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

  • @paschalokafor9043
    @paschalokafor9043 ปีที่แล้ว

    You can also use propsWithChildren generic type for children

  • @mrrishiraj88
    @mrrishiraj88 2 ปีที่แล้ว +1

    🙏👍

  • @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)

  • @MohammedAlziko
    @MohammedAlziko 4 หลายเดือนก่อน

    ❣❣❣💯💯💯

  • @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 ปีที่แล้ว +1

      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 = "";

  • @irotv7584
    @irotv7584 ปีที่แล้ว

    You sound like freeze youtuber, am I wrong ?

  • @Bradcopo
    @Bradcopo 2 ปีที่แล้ว

    😋😋

  • @sulochanakharat9033
    @sulochanakharat9033 2 ปีที่แล้ว +1

    Sir are you Indian ?? If yes please make vedio in hindi 🙏🙏🙏