What is the difference between calling a function(component) or writing its name in a tag when we render it from ReactDOM? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

What is the difference between calling a function(component) or writing its name in a tag when we render it from ReactDOM?

Is JSX infact like a function that when we call it returns objects to be rendered on the page? https://code.sololearn.com/WFhA3b4GZY2C/?ref=app

16th Feb 2023, 3:05 PM
Javascript Developer
Javascript Developer - avatar
2 Antworten
+ 1
You can read an in depth explanation of React Components here: https://reactjs.org/docs/react-component.html To give you a short answer here, "yes." When you create a component in React, the JSX is an object that is then rendered to the view with JavaScript. That is why the render method is required for all components and why the argument for the render method is HTML; React components exist on the page through the render method.
17th Feb 2023, 2:03 AM
Sam
0
Sammy Raven thanks🙏🏽
17th Feb 2023, 4:30 AM
Javascript Developer
Javascript Developer - avatar