+ 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
Learning Python
2 odpowiedzi
+ 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
Learning Python