Functional Component
Functional Component
---------------
import React from "react";
function Home
{
return(
<div>
<a href="http://www.google.com"><Google></a>
<h1>hello heading</h1>
</div>
);
}
export default Home;
-------------------------------------------------
class component
return(
<div>
<h1 >Hello This is Class Component</h1>
</div>
);
}
export default Contact;
-----------------------------------------------------------------------------
css syntax
function App()
{
return (
<div className="App">
<img src='slide-1.jpg' style={width:" 100%", height:"300px"}}
alt="None" />
<h1 style=f{color: "green", background:"yellow">Hello World</h1>
<h2>This is React Session</h2>
<Home />
<hr />
‹Contact />
<hr />
<About />
</div>
);
}
export default App;
-------------------------------------------------------------
arrow function
return(
<div>
<h1 > This Component is created using Arrow Function</h1>
</ div>
);
}
export default About;
-----------------------------------------------------------------