ReactJS Tutorial - 8 - JSX

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 4. 11. 2018
  • 📘 Courses - learn.codevolution.dev/
    💖 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
    JavaScript XML (JSX) is an extension to the JavaScript language syntax. With React, it's an extension to write XML-like code for
    elements and components. And just like XML, JSX tags have a tag name, attributes, and children.

Komentáƙe • 187

  • @Codevolution
    @Codevolution  Pƙed 5 lety +52

    React Fire - github.com/facebook/react/issues/13525

  • @dasojushiva8663
    @dasojushiva8663 Pƙed 2 lety +57

    dude... I am halfway through the video and I already like the way that is being explained, though am a newbie... it was very clear to me. initially, i thought JSX pros all are like complicated things to learn... but I know there are smart people like you who made the world so beautiful.

  • @adetolasanni007
    @adetolasanni007 Pƙed 2 lety +9

    Great tutor ever you took your time and energy to explain every bit of the course. Thank you so much.

  • @uodige1
    @uodige1 Pƙed rokem +3

    another easy-to-follow tutorial, I am so glad I am improving my React skill thru these tutorials!!

  • @noahqyain7311
    @noahqyain7311 Pƙed 2 lety +4

    I JUST love how enthusiastic Desi people are about their tech careers. It is kind of cute how they run to make videos and are prideful of their knowledge unlike no other culture or ethnicity in the world TBH. They are probably the most cognitive of the mediocre knowledge needed to work in technology and the pay out being greater than the required input in man hours to learning such information.

  • @PadmanabhRudrawar
    @PadmanabhRudrawar Pƙed 2 měsĂ­ci +1

    I am truly grateful that you have created these videos. These videos are relevant even in 2024, i.e. 5 years since its inception. On top of that, these are all free. I wish to see each and every video related to React as my current job requires me to be good in React. I wish to do something for Codevolution as a token of gratitude. Let me know if there is a way to contribute 😇

  • @viveks2619
    @viveks2619 Pƙed 3 lety +33

    Instead of nesting the Createelement function, 'return React.createElement('div',null,Hello Again)', This works perfectly fine.

    • @total_breathing
      @total_breathing Pƙed 2 lety +5

      React has evolved

    • @josk8936
      @josk8936 Pƙed rokem +3

      arent you using just more jsx inside the child paramenter?

    • @pallavimahanta519
      @pallavimahanta519 Pƙed rokem

      @@total_breathing hey should i follow the whole playlist in 2023 .curreantly i have not started reactjs . Iam searching for a good playlist .can u suggest me

    • @faizanahmed9304
      @faizanahmed9304 Pƙed rokem +2

      ​@@pallavimahanta519yes you can i know its quite older but the basic fundamentals are same

    • @Mahi.375
      @Mahi.375 Pƙed 10 měsĂ­ci

      You use html tag in return that is jsx
      He teach without jsx

  • @krisssachintha
    @krisssachintha Pƙed 4 lety +9

    Super understanding tutorials, now i like to work with react js, thanks for good content

  • @CANIHAZURDREAMSPLS
    @CANIHAZURDREAMSPLS Pƙed 3 lety +1

    This answered many questions for me! Great video!

  • @poojaguru2516
    @poojaguru2516 Pƙed rokem

    Your videos are the best ever! Glad i found your channel.

  • @kalmi_riding
    @kalmi_riding Pƙed 4 lety +53

    So if I understand well, our previously created Welcome and Greet component returned with JSX, right?

  • @colindante5164
    @colindante5164 Pƙed 2 lety

    With such an awesome tutorial the least I could do is subscribe. )) Thankyou for such a clear explanation. )))

  • @dhl4102
    @dhl4102 Pƙed 4 lety +9

    You Rock! Such a great tutorial

  • @karthi321ful
    @karthi321ful Pƙed 5 lety +1

    awesome tutorial series , Thanks Vishwas.. following

  • @SpiritualManish
    @SpiritualManish Pƙed 3 lety +2

    Thank You for such a nice tutorial series Vishwas. I am using react 17.0.1 and I don't need to import react in functional components.

  • @JohnDoe-rj2kf
    @JohnDoe-rj2kf Pƙed 3 lety +2

    what is the difference between the .js or .jsx extenstion when writing the react component ?

  • @ricklove8358
    @ricklove8358 Pƙed 2 lety

    man this is so helpful. keep up with the good work.

  • @Colstonewall
    @Colstonewall Pƙed 5 lety +2

    Thank you, Vishwas!

  • @KOSAMAGAMES
    @KOSAMAGAMES Pƙed 3 lety +3

    doing the second one threw me back in time.

  • @VijayaKumar-qv7mw
    @VijayaKumar-qv7mw Pƙed 4 lety

    Great Explanation Loved it thanks

  • @rahulnag9582
    @rahulnag9582 Pƙed 5 lety +1

    using the div tag makes it a JSX or making it a cont function makes it a JSX ?

  • @ravitejakambaluru1330
    @ravitejakambaluru1330 Pƙed 3 lety

    @codevolution how can I write multiple class names for single elements. For examples in case of using bootstrap classes

  • @karolinalencina7121
    @karolinalencina7121 Pƙed 3 lety +1

    Thank you, that was super clear! :-)

  • @rabiehaed
    @rabiehaed Pƙed 4 lety

    Excellent explanation, Thanks

  • @alvinrobert3927
    @alvinrobert3927 Pƙed 4 lety

    Really ur way of teaching really awesome 👍👌👌

  • @shloch2007
    @shloch2007 Pƙed 4 lety +5

    very much a GREAT TEACHER ................. thank you

  • @kirankamath5891
    @kirankamath5891 Pƙed 3 lety +1

    The reason why we imported React from "react" was clearly understood Sir , thanks for that.

    • @sdeneham25271
      @sdeneham25271 Pƙed 3 lety

      Why?

    • @kirankamath5891
      @kirankamath5891 Pƙed 3 lety

      @@sdeneham25271 so that it uses React.createElement while compiling , but while coding you need to simply use JSX for syntax

    • @shishirrai1069
      @shishirrai1069 Pƙed 3 lety

      @@sdeneham25271 it is not required with version 17

  • @manueljordan317
    @manueljordan317 Pƙed 3 lety

    Excellent, well covered!

  • @ericmuhire9995
    @ericmuhire9995 Pƙed 2 lety

    Great tutorials. Thank you 🙂

  • @richardmartyns7978
    @richardmartyns7978 Pƙed 2 lety

    I started learning react here, hope am on the right track and there is no new changes

  • @gopalakrishnamurthy7862
    @gopalakrishnamurthy7862 Pƙed 3 lety

    Superb explanation I loved it

  • @visweswarbk7611
    @visweswarbk7611 Pƙed 2 lety

    Excellent presentation !

  • @negros111
    @negros111 Pƙed 2 lety +1

    I have problem Compiled with problems:X
    ERROR in ./src/App.js 14:43-48
    export 'Greet' (imported as 'Greet') was not found in './components/Greet' (possible exports: default) ?

  • @MatheusPereira-nn9dj
    @MatheusPereira-nn9dj Pƙed 2 lety

    can i use emmets inside create.element to maybe nest parent div and child div??

  • @amolsd8706
    @amolsd8706 Pƙed rokem

    you are an awesome.....
    happy learning react.

  • @suzsg6169
    @suzsg6169 Pƙed 5 měsĂ­ci +4

    This is a bit outdated explanation. JSX no longer requires importing React and translation works differently under the hood. New translation: _jsx('h1', { children: 'Hello world' }); instead of React.createElement('h1', null, 'Hello world');

  • @nikimehta5323
    @nikimehta5323 Pƙed 3 lety

    according to your tutorial i have import a jsx element but it does not show anything i have used default export also and my path in another page is also correct

  • @harshdevmurari007
    @harshdevmurari007 Pƙed rokem

    hats off to ypur explaination sir.................

  • @vaibsify
    @vaibsify Pƙed 2 lety

    awesome explanation 🙏

  • @sonofsatan3196
    @sonofsatan3196 Pƙed rokem

    Why did we use parenthesis for return in Hello.js, while in greet there wasn't, I'm a newbie to react

  • @uniquezay2019
    @uniquezay2019 Pƙed 9 měsĂ­ci

    Hello Vishwas, why the code didn't work as it should at 5:16 was because the Hello Vishwas was inside of a quote, I wrote it without the quote and it worked.

  • @rahulnag9582
    @rahulnag9582 Pƙed 5 lety +1

    hi sir,
    if we write the Hello function as function Hello() {
    }
    the it will be a JSX or not ?

    • @yogibaba6008
      @yogibaba6008 Pƙed 5 lety +1

      Arrow function or ES5 function has nothing to do with JSX. Basically what you are returning from your function is JSX . You can also return JSX from class based component.

  • @LearnWithNoor036
    @LearnWithNoor036 Pƙed rokem +1

    I am watching your series on January 2023.Thanks for your hard work on this Course. You should teach in Udemy.

  • @lathagm666
    @lathagm666 Pƙed 9 měsĂ­ci

    completed 8th video. thank you 🙂

  • @bollywoodclassichitslyrics2242

    Please upload more videos on react and react native

  • @Aditya.Santra
    @Aditya.Santra Pƙed 2 lety

    Very Helpful Video 👍

  • @yerraguntlaharish4109
    @yerraguntlaharish4109 Pƙed 4 lety

    @Codevolution sir i am seeing this series now am i good to go or are there any changes

  • @zribiahmedyassine1582
    @zribiahmedyassine1582 Pƙed rokem +3

    is this serie still usefull in 2023 @Codevolution ?

    • @kristijanlazarev
      @kristijanlazarev Pƙed 11 měsĂ­ci

      Yes, 90% of the course is basics, and is still relevant today!

  • @bikashbhandari5608
    @bikashbhandari5608 Pƙed 4 lety

    How many times we have to use react.createElement if there is many child inside div?

    • @SalmanMKC
      @SalmanMKC Pƙed 4 lety

      That's for demonstration purposes I guess, it's much easier to use jsx and no need to have to learn the js implementation! :)

  • @ashapilkhwal6320
    @ashapilkhwal6320 Pƙed 3 lety

    Really appreciable!!

  • @aku_11_11
    @aku_11_11 Pƙed 3 lety

    Awesome tut sir, plz make tut on java script full course too sir..

  • @smilybhanu7779
    @smilybhanu7779 Pƙed 3 lety

    Good..great tutorials

  • @Sandeep_trader17
    @Sandeep_trader17 Pƙed 2 lety

    Line 3:9: 'Greet' is defined but never used no-unused-vars
    Line 4:9: 'Welcome' is defined but never used no-unused-vars
    getting these error and nothing is printing on web could you help me with the same

  • @JYOTSNA018
    @JYOTSNA018 Pƙed 4 lety +4

    using React.createElement though returns a line here, but can be highly tedious when it comes to entire page, and the same is easily achieved by functions(greet) why then is it even used?

    • @backseatgaming9087
      @backseatgaming9087 Pƙed 3 lety +1

      It is advantagous if you want to use XML later on to manipulate the DOM tree

  • @sandeshdeshmukh2136
    @sandeshdeshmukh2136 Pƙed 5 lety

    thank you so much

  • @iFFOKMedia
    @iFFOKMedia Pƙed 5 lety

    You saved me!

  • @ngsuraj
    @ngsuraj Pƙed 4 lety

    Is it not mandatory to use .jsx extension when we use jsx in a react file?

  • @whynot-vq2ly
    @whynot-vq2ly Pƙed 4 lety +6

    are we going to make something else then greeting Vishwas in the coming tutorials ? :D
    in the meanwhile I find the tutorials amazing, thanks a lot :]

  • @alvinrobert3927
    @alvinrobert3927 Pƙed 4 lety

    I'm one fellowing u to all the videos to learn react .js

  • @zoemohamed6599
    @zoemohamed6599 Pƙed 2 lety

    Thank you sensei

  • @domnicrozariod7367
    @domnicrozariod7367 Pƙed 5 lety

    showing an error with curly braces before and after your return types so pls help me out?

  • @gauravpant770
    @gauravpant770 Pƙed 3 lety

    how your element was aligned at center and not mine ???

  • @yaminnather521
    @yaminnather521 Pƙed 3 lety

    That HTML jsx syntax looked a bit weird at the beginning but u explained how it actually works really well

  • @100mdabrarhussain9
    @100mdabrarhussain9 Pƙed 3 lety

    its give error:
    TypeError: Class extends value undefined is not a constructor or null

  • @kornkorn1699
    @kornkorn1699 Pƙed 7 měsĂ­ci

    some reason i got Uncaught runtime errors how to fix it

  • @lakshaymangu899
    @lakshaymangu899 Pƙed 3 lety +2

    This video is uploaded in Nov 2018. Can I refer this tutorial for freshly learning React JS now in Mar 2021? Please help :)

  • @weslolo1074
    @weslolo1074 Pƙed 2 lety

    glad jsx exists

  • @visweswarbk7611
    @visweswarbk7611 Pƙed 2 lety

    Do not see the name and introduction of tutor anywhere ....just curious to know who is doing this great presentation !

  • @madhurikas_music
    @madhurikas_music Pƙed 8 měsĂ­ci

    Excellent!

  • @roopsoops202
    @roopsoops202 Pƙed 2 lety

    Is React.createElement still used in react 18? Newbie here!

  • @chetannagar7467
    @chetannagar7467 Pƙed 10 měsĂ­ci +1

    Please confirm if it is valid at this time ?

  • @YusanTRusli
    @YusanTRusli Pƙed 3 lety

    Is there any tutorials for Svelte?

  • @uodige1
    @uodige1 Pƙed rokem

    I am sorry, but how do I write "//" multiple times at once?

  • @GavinWoodthebarbarian
    @GavinWoodthebarbarian Pƙed 3 lety +2

    Forgive me for my ignorance but I cannot see how react is "better" than Angular. I prefer where my components are in their own separate structure with html js and css separated from each other. maybe we still getting to something like that down the line but so far React seems way more complex to me that Angular.

  • @akshithaelukapalli184
    @akshithaelukapalli184 Pƙed 7 měsĂ­ci

    Will u please provide any other alternatives to solve the queries sir

  • @osmangoni2341
    @osmangoni2341 Pƙed rokem

    Thanks a lot.

  • @mrinaldas6220
    @mrinaldas6220 Pƙed 3 lety

    Good tutorial video

  • @karteekkosaraju218
    @karteekkosaraju218 Pƙed 2 lety +2

    Hello Vishwas,
    please include the source files too..that way , it's a great help
    Thanks in Advance

  • @co-de-code
    @co-de-code Pƙed 3 lety +1

    Sir it's working even if I type // return React.createElement('div',null,'Hello Rohith')

  • @vasantht3379
    @vasantht3379 Pƙed 5 lety

    Thanks boss

  • @nogafouz2174
    @nogafouz2174 Pƙed 2 lety

    thanks alot

  • @sameeramrutia18
    @sameeramrutia18 Pƙed 3 lety

    which screen recording tool you are using? can you please tell me?

    • @viveks2619
      @viveks2619 Pƙed 3 lety

      You can access the one available in the windows by pressing win+g

  • @toannew
    @toannew Pƙed 3 lety +5

    6:23 js code (not jsx code)
    8:46 compare code of jsx and js.
    10:19: jsx syntax and what is going to change (className -> class)

  • @riyasri7991
    @riyasri7991 Pƙed rokem

    Why in my vscode jsx is not executing?

  • @sonali2720
    @sonali2720 Pƙed 2 lety

    Hi , can you please upload videos for react typescript testing using jest

  • @ankurtiwari861
    @ankurtiwari861 Pƙed 4 lety

    Sir what shortcut keys did you use to comment out Greet? Great tutorial btw!

  • @Unknown_vibe952
    @Unknown_vibe952 Pƙed 3 lety

    sir i am not able to write anything in new folder (hello.js) red line is showing after the return statement

  • @vinodp7508
    @vinodp7508 Pƙed 4 lety +1

    below code also works properly...try it
    import React, {Component} from 'react'
    const hello = () => {
    // return (
    //
    // Hello sachin patil
    //
    // )
    return React.createElement('div',null,Hello vinod)
    }
    export default hello

    • @monchoisalive
      @monchoisalive Pƙed 4 lety

      Any idea why this code works for you, but it doesn't for Vishwas?

  • @javadmohammadi3943
    @javadmohammadi3943 Pƙed 3 lety

    hi its perfect .thanks

  • @KevinEontrainer381
    @KevinEontrainer381 Pƙed 4 lety +1

    9:01 insert troll face here

  • @mirusvet
    @mirusvet Pƙed 4 lety

    2:55 What is the shortcut to instantly write the import line? Thanks

    • @jeremyt7817
      @jeremyt7817 Pƙed 4 lety

      he probably just copied and pasted for the sake of the video.

    • @mirusvet
      @mirusvet Pƙed 4 lety

      @@jeremyt7817 figured it out, react does it, if you auto complete, thanks

    • @ammarkhan5658
      @ammarkhan5658 Pƙed 4 lety +1

      use *simple react snippets* extension in vs code for autocomplete

  • @yashraj6565
    @yashraj6565 Pƙed 2 lety

    Just.. Thank you

  • @jyotsnarachapudi2017
    @jyotsnarachapudi2017 Pƙed 4 lety +4

    return React.createElement('div', null, Hello Vishwas )
    This works fine as we expect.
    Please let me know why dont we use this.

    • @abbasshaikh3115
      @abbasshaikh3115 Pƙed 4 lety

      It's just a point of preference

    • @sunnyparmar9692
      @sunnyparmar9692 Pƙed 4 lety +4

      Instead of using React.createElement and passsing three parameters, JSX is much easier to write and understand the flow of code.
      So try to use JSX for simplicity.

    • @aravindb6025
      @aravindb6025 Pƙed 4 lety

      consider nesting of 8 to 10 elements inside div element which will be difficult so we prefer jsx way which is like writing html and hassle free

  • @alexb.2616
    @alexb.2616 Pƙed 4 lety

    Thanks

  • @surabhisharma5169
    @surabhisharma5169 Pƙed 4 lety

    How to view elements?

  • @nadicadizdarevic2835
    @nadicadizdarevic2835 Pƙed 2 lety

    🙂Thanks.

  • @anjanasanthosh1040
    @anjanasanthosh1040 Pƙed 3 lety

    Thankyou

  • @latasha2123
    @latasha2123 Pƙed 4 lety

    For me it is not showing the id value in the inspect.

  • @zakaryalaarrague
    @zakaryalaarrague Pƙed 7 měsĂ­ci

    thanks

  • @bryanhui3797
    @bryanhui3797 Pƙed 4 lety

    what happened at 2:57? How to import Hello without typing?

    • @bryanhui3797
      @bryanhui3797 Pƙed 4 lety

      Also at 6:33, how to format the code?