Components
Components
main.jsx
Note : In class based component there is one built in property called as state so
class based component called as statefull Component.
Function based component :
App.jsx
main.jsx
App.jsx
In this example code inside return (<h1> Functional Component</h1>) statement looks similar
to HTML, but it is actually JSX.
JSX RULES :
1) When you want to render more than one element wrap them with one
parent and ( )
Note : In the above example we have used <div> </div> as a parent .So in
this case <div></div> will create one new node. In order to avoid this we
have to use fragments as a parent.
<br />
<br> Or
<br></br>
App.jsx
3) In JSX in order access the variable we need to wrap them with { }
4) CamelCase Conventions
HTML JSX
class className
for htmlFor