Hello, world:
Open index.js file :
Example --
Const root = ReactDom.createRoot(getElementById("root")
root.render(component or HTML );
Render() -- it is used to display HTML on a web page(render the content...)
It accepts HTML code or components.
Babel syntax: it is an old syntax and complex also
Syntax : React.createElement(tag_name , {attributes}, content);
It accepts three parameters :
Examples :
only h1 tag:
return (
React.createElement(h1,{className:"h1"}, "Babel syntax")
)
parent and child tags:
return (
React.createElement(div, {className:"parent"} ,React.createElement(h1,{className:"h1"}, "Babel syntax")
)