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

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

    1:35 - IF/ELSE
    5:07 - Element Variables
    7:06 - Ternary Conditional Operator
    9:20 - Short Circuit Operator

  • @morhaham6609
    @morhaham6609 4 ปีที่แล้ว +21

    For anyone who wonders why can we put jsx element inside a variable without it being a string, it's because jsx elements are just wrappers for function calls. so:
    let message = hello
    is the same as:
    let message = document.createElement('div');
    message.innerHTML = "hello";

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

      I think this is partially correct. My guess is that it compiles to:
      let message = React.createElement('div', 'hello');

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

      ooooh thank youu i always felt weird typing it but now i know what it means :D

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

    For those who are watching this in 2022 and are unhappy that Vishwas is using classes instead of functions, you can code along using functions. make sure that instead of creating a constructor with this.state={someProperty: "someValue"}, you just create a useState hook like this: const [someProperty, setSomeProperty] = useState("someValue"). Make sure you import {useState} from 'react'. Also whenever Vishwas is using this.setState("anotherValue") to change this.state, you simply uset setSomeProperty("anotherValue") and the state/someProperty changes. And last thing I want to mention is you don't need render (), just return.

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

      Vishwas has also taught React hooks though in the later part of the series..

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

    Thank you so much! You're an inspiration, I follow your tips, tricks, and suggestions wherever applicable and feel grateful for your presence on TH-cam!

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

    After going through so many different paid and unpaid tutorials, I can this one is the best among all.

  • @m_abosalem
    @m_abosalem 5 ปีที่แล้ว +29

    you make complex stuff, very simple , thank you.

    • @fennecLens
      @fennecLens 5 ปีที่แล้ว

      this guy is really doing great things..am i right???

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

      @@fennecLens Of course you are right, hope to complete the series

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

    Thank you for the great full course Vishwas bro. I have tried to explore all of the popular tutorials on TH-cam. Almost all of these videos do not attempt to provide full instructions. They just cover the basics and say if you want to get the full tutorial click the link below and get it with a discount. So it is a sorta advertisement. But your course is better than theirs. Even Mosh Hamedani's react course cannot provide as clear details as yours can. I APPRECIATE YOU BROTHER. THANKS FROM UZBEKISTAN.

  • @noblepolygon8694
    @noblepolygon8694 5 ปีที่แล้ว +7

    I literally watched the first 3 minutes of your video and was able to write my first if/else statement in react...thank you!

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

    0:35 frou kinds of conditional rendering
    4:40 JSX is syntactic function of ...
    5:10 2nd approach: element variable approach
    7:58 3rd approach: ternary condition operator (recommended)
    9:10 4th short-circuit operator approach (recommended)

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

    The best teacher i've ever seen.

  • @elchino7672
    @elchino7672 3 ปีที่แล้ว

    This course is unbelivable. It worth a lot

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

    Sir this react series is best series in TH-cam now.
    thanks a ton for your effort.

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

    00:24 - different types
    00:35 - If / Else
    05:07 - Element Variables
    07:06 - Ternary Conditional Operator(? :)
    09:20 - Short Circuit Operator(&&)
    Thank me later.

  • @SaurabhR777
    @SaurabhR777 12 วันที่ผ่านมา

    00:05 Conditional rendering in React allows showing or hiding HTML based on conditions.
    01:39 Adding conditional rendering in ReactJS
    03:12 Conditional rendering in ReactJS with if-else statement
    04:49 Conditional rendering in ReactJS using if-else statements and element variables
    06:26 Implement ternary conditional operator for simpler JSX rendering
    08:00 Conditional Rendering in ReactJS using ternary operator
    09:19 Conditional rendering in ReactJS using short-circuit operator.
    10:38 Four approaches to conditionally render UI in React

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

    Hey dude, I am very happy about this your tutorial! :)
    You helped me to find a way to solve some of my own ideas in coding in some advances from the previous lessons.
    GREAT JOB!!! (Y)

  • @noureddinezekaoui4546
    @noureddinezekaoui4546 3 ปีที่แล้ว

    Creating a new file in the components folder every time we switch to another concept is just an amazing choice to keep track of our previous work and come back to it later if we need to! thank you very much for the amazing content. keep it hight and up !!!

  • @RoadsInCanada
    @RoadsInCanada 4 ปีที่แล้ว

    Dear Vishwas,
    Hats off to you for all the video tutorials. I've learned a lot from this channel. Keep up the good work. 👍

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

    You are an amazing tutor

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

    ¡Amazing! It has helped me a lot, thanks.👏🏻

  • @unknowuser2601
    @unknowuser2601 3 ปีที่แล้ว

    old but good, You guy make my learn so easily ❤️❤️❤️

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

    Is it ok to use first/second approach? I really don't respect 3rd and 4th and never used it before, I should get familiar with it through time.

  • @dcombsdotio8662
    @dcombsdotio8662 4 ปีที่แล้ว

    This is incredible content - thank you for all of your hardwork in creating such an easy-to-follow tutorial!

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

    How is he immediately able to change the closing tag to an auto-closing tag. Like to . Is there any keyboard shortcut for this?

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

    Man, you are awesome. A terrific tutorial indeed. Love you buddy!

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

    reallythanks alot you have excellent way to explaine

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

    completed video 16. Thank you 🙂

  • @HussainsTechStack
    @HussainsTechStack 4 ปีที่แล้ว

    return this.state.isLoggedIn && Welcome Logged || Guest Please add || condition, so that it will have both condition which is better approach

  • @MarleySkunk
    @MarleySkunk 3 ปีที่แล้ว

    im stuck in vanilla javascript... but this makes sense much much more

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

    Awesome very good explanation, Thanks

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

    U are doing grt sir...can you tell me which snippet you are useing for code in react

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

    1:33 - IF/ELSE, 5:05 - Element Variables, 7:07 - Ternary Conditional Operator, 9:22 - Short Circuit Operator

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

    Is there any difference other than the syntax ?
    // Type3: Ternanry Operator
    return this.state.isLoggedin ? Welocme Vignesh : Welocme Guest
    // Type4: ShortCircuit Condition
    return this.state.isLoggedin && Welocme Vignesh || Welocme Guest

  • @MuhammadAhmed-wb2sq
    @MuhammadAhmed-wb2sq 2 ปีที่แล้ว

    Thanks for the video. Really helpful

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

    You can also: (
    this.state.condition && outcome A || outcome B
    ).
    Or : (
    this.state.condition ? outcome A : null
    ).
    Not really important, in general these operations do the same thing, just good too know that.

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

    in case of short circuit approach how can we print something in UI if the first condition is false

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

    The tutorial is super. My only concern is related with return statements in the render method, it is no clear when we use parenthesis, when we use curly braces and when nothing. For example in this video when element variables used as an option, the {message} variable can't used without div's, this is strange because the {message} is already included in div tags at the if/else statements.

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

      I know this is a relatively old comment but I'll just input what I understood so that it might give others an idea.
      Regarding the element variables method, remember that returned JSX elements always have to be enclosed within a single tag (usually div). In the example code the final message variable returned does not actually require an outer div tag before returning because it is storing only one tag inside, but if the message variable stores multiple tags like maybe a div tag and a button outside the div, then enclosing the message variable within an outer div tag before returning ensures errors do not happen.
      Regarding the return statements, we use parenthesis when we have more than one executing statement. So if you are using Ternary operator methods, the whole a ? b : c or a && b are single executing statements and hence do not require parentheses, whereas each JSX tag are individual executing statements so better to enclose them in parentheses if you have more than one JSX tag. To avoid confusion you can opt to use parentheses all the time.

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

    Hi bro, your tutorials are really helpful for learning ReactJs. Thanks a lot for your help

  • @laharinamala8373
    @laharinamala8373 4 ปีที่แล้ว

    Extraordinary explanation , thank you Sir.

  • @VishalSharma-rn7mt
    @VishalSharma-rn7mt 3 ปีที่แล้ว

    Awesome explanation

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

    awesome explanation 🙏

  • @burhanali9117
    @burhanali9117 3 ปีที่แล้ว

    Saw a free react course...
    Here goes my subscribe

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

    hello sir what is container and presentation component

  • @Naveen-xz6ml
    @Naveen-xz6ml 4 ปีที่แล้ว

    This is just awesome buddy.
    Needed to let you know that you have saved the day for me

  • @marypaul9627
    @marypaul9627 3 ปีที่แล้ว

    You are tutorials so good,why are you not posting in udemy so we can buy from you

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

    I wish that would be more with functions than classes :D

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

    can we get code snippets for every lecture ?

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

    nice tuturial

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

    I've noticed that throughout the whole course you've never used a semicolon to break your statements... I wonder if it makes a difference and why would we use it sometimes? thank you

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

      Java script treats every line break as an "implicit" semicolon. This is called java script "automatic semicolon insertion". In most cases new line implies a semicolon but every new line does not mean a semicolon. Hence only seasoned developers should omit semicolon as they are aware of its pros and cons.

    • @SheshagiriPai
      @SheshagiriPai 3 ปีที่แล้ว

      We MUST use it for CSS in javascript.

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

    Your explanation is just amazing Sir :)

  • @poornachandrag6407
    @poornachandrag6407 3 ปีที่แล้ว

    Clean and clear better than paid tutorials

  • @ekinsuflashege2402
    @ekinsuflashege2402 4 ปีที่แล้ว

    bu güzel anlatım için çok teşekkür ederim. ingilizce bilmediğim halde yinede anlıyorum. sizin gibi değerli insanlara ihtiyacımız var.

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

    Thanks!! Vishwas. I think it's better than paid...

  • @Aditya.Santra
    @Aditya.Santra 3 ปีที่แล้ว

    Amazing Video

  • @ai.201
    @ai.201 4 ปีที่แล้ว

    Better then any paid course

  • @zainabideen8144
    @zainabideen8144 3 ปีที่แล้ว

    How can we return welcome guest with the fourth approach?

  • @bhojakrahul5880
    @bhojakrahul5880 4 ปีที่แล้ว

    how to set render condition in my form is data is not there see "add button" and data is there in databse see "update button"

  • @mamunethan1356
    @mamunethan1356 3 ปีที่แล้ว

    Love from Bangladesh

  • @rahmanrio7194
    @rahmanrio7194 4 ปีที่แล้ว

    How can I use this kind of condition inside map function ,it does not support inside map .

  • @lasithadulshan7357
    @lasithadulshan7357 3 ปีที่แล้ว

    Thank you .. Good Job

  • @jakubgadzala7474
    @jakubgadzala7474 3 ปีที่แล้ว

    By now, I already love welcoming Viswas 🤣

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

    why did we use return {message}, not return {message} ?

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

    This stuff cannot be nested. It has to be toplevel inside the return statement.

  • @lijojohn6273
    @lijojohn6273 5 ปีที่แล้ว

    render() {
    if(this.state.isLogedin){
    return(
    Welcome Lijo)
    }else{
    return (
    Welcome Guest)
    }
    This is correct format

  • @AxxionMarketPlace-iu6ri
    @AxxionMarketPlace-iu6ri ปีที่แล้ว

    Thank you

  • @muaazhammad4446
    @muaazhammad4446 3 ปีที่แล้ว

    Why does React don't have directeve like v-if or v-show to conditionaliy render data just like in Vue ???. it is much simpler and easer

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

    8:26 What key was pressed to format the code?

    • @conaxliu9677
      @conaxliu9677 4 ปีที่แล้ว

      @Gabriel Daniluk Thank you. :)

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

    thank you so much

  • @meidymahardika6435
    @meidymahardika6435 5 ปีที่แล้ว

    what is your plugin in mnt 8.25 for complete your coding

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

    in jsx (return) part - can't write if/else
    but in render method outside jsx, can write if/else, variable decla&usages, ternary operator, logical &&
    - to conditionally render UI in react:

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

      Its so weird that we can't use `if...else` but can use ternary.

  • @wilghensantos
    @wilghensantos 3 ปีที่แล้ว

    this is great. I only wish this can be updated to react hooks.

  • @moderncloth682
    @moderncloth682 4 ปีที่แล้ว

    I love you, Vishwas.

  • @noorbohsas489
    @noorbohsas489 5 ปีที่แล้ว

    amazing !
    what's the name of the fourth approach again?

    • @syntaxcake4545
      @syntaxcake4545 5 ปีที่แล้ว

      Noor, fourth approach is short circuit operator

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

    Thnx loads...

  • @michaelrooze278
    @michaelrooze278 4 ปีที่แล้ว

    But how does the component know if its logged in or not?

  • @shushmapatil
    @shushmapatil 5 ปีที่แล้ว

    At 8.29 you adjusted the code, what is the shortcut to do so?

    • @HPec-ax
      @HPec-ax 3 ปีที่แล้ว

      i guess its code formatter prettier

    • @mareboinaravi5272
      @mareboinaravi5272 3 ปีที่แล้ว

      It's VS Code extension

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

    ./src/components/UserGreeting.js
    SyntaxError: C:\Users\Dell
    eact app\hello\src\components\UserGreeting.js: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (5:2).....What kind of error is this?

    • @abhijeetjadhav2606
      @abhijeetjadhav2606 4 ปีที่แล้ว

      @milan poudel : you get error because you missed to extend it from component
      Write class UserGreeting extends Component {} instead of class UserGreeting {}

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

    thanks

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

    {this.state.isLoggedIn ? (Welcome Vishwas) : (Welcome Guest)}

  • @lincolemos
    @lincolemos 5 ปีที่แล้ว +31

    I'm coming from Vue/Angular. I wanna kill myself after discover how React manages conditional rendering.
    I'm dead.

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

      Why man??
      In Angular, we have coolest directives , right;)
      Live with that

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

      fuckin right i thought i should give react a try i am from vue background and the way react handles iterative elements and conditional rendering its disgusting

    • @KanecoV
      @KanecoV 3 ปีที่แล้ว

      @@dawoodchaudary8736 Does that mean its a lot harder?

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

      @@KanecoV its a bit different in a sense but you get hold of it after working in it
      Not harder but comparing to Vue .React conditional renedering and iterating syntax is inferior 😂

    • @ahmadsaleh7887
      @ahmadsaleh7887 3 ปีที่แล้ว

      I totally agree. Angular is way more elegant but I have to learn this because unfortunately it's more popular in the industry

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

    nice tutorial

  • @eurythmia9840
    @eurythmia9840 4 ปีที่แล้ว

    thank you!! great tutorial series!!

  • @9a56mahabirjaiswal9
    @9a56mahabirjaiswal9 2 ปีที่แล้ว

    please update it usi g functional component ,It's becomes too difficult to understand

  • @ameetshrestha6424
    @ameetshrestha6424 5 ปีที่แล้ว

    What theme are you using for VS Code Editor? Really loved that Theme..

    • @AM-ey2vn
      @AM-ey2vn 5 ปีที่แล้ว +1

      Should be the default one, at least its for me

  • @andy.n3
    @andy.n3 5 ปีที่แล้ว

    Thanks!

  • @shaheedk-sm7ho
    @shaheedk-sm7ho หลายเดือนก่อน

    is your name vishwas?

  • @jagdishshetty4782
    @jagdishshetty4782 5 ปีที่แล้ว

    Great basics explanation !!! Thx !!!

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

    but if else it also works in jsx

  • @lopyus
    @lopyus 5 ปีที่แล้ว +5

    I found another way to this
    Welcome {this.state.isLoggedIn?"Ashish":"Guest"}

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

    in angular we just use *ngIf within the element haha

    • @muaazhammad4446
      @muaazhammad4446 3 ปีที่แล้ว

      yaa and in Vue just use V-if, don't know why react is so complex for conditionl rendering

  • @luismendoza8428
    @luismendoza8428 4 ปีที่แล้ว

    if state changes after initial rendering

  • @shoaibamin4342
    @shoaibamin4342 4 ปีที่แล้ว

    @vishvas i am very thankfull to u. greate job

  • @burhanali9117
    @burhanali9117 3 ปีที่แล้ว

    it will be great if you upgrade your course to react 2021 you surely will get lots of views

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

    10:00 Short Circuit Operator double ampersand operator

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

    Good day wishes

  • @noordinabdulkadir351
    @noordinabdulkadir351 4 ปีที่แล้ว

    going through this playlist like snacks

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

    🎓

  • @deepikasrinivasasharma7481
    @deepikasrinivasasharma7481 4 ปีที่แล้ว

    what about jsx file

  • @animaldemonstrations6519
    @animaldemonstrations6519 4 ปีที่แล้ว

    that's good

  • @abhishekbajaj109
    @abhishekbajaj109 4 ปีที่แล้ว

    I had a doubt I am unable to remember this all in react i might remember what is what but not the syntax can you tell what to do?plz help

  • @shouhardik09
    @shouhardik09 4 ปีที่แล้ว

    how to comment multiple lines using // with a single try?

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

      select the lines and click ctrl + '/'

    • @siemen_subbaiah
      @siemen_subbaiah 4 ปีที่แล้ว

      install the Babel Javascript extension in VS Code!
      and then select the lines and hit this shortcut key : ctrl + '/'