You are on page 1of 1

App.

jsx -

How to create a function>?


there are two ways-
* const App - () ->
* function App()

* whatever we want to be displayed on the website inside a component , we write it


in- return(

Why is <div> tag required?


- whatever html tag you write inside return it has to be wrapped inside a parent
element i.e <div>. If you have multiple components
they cannot exsist parallely , until and unless they are wrapped with some tag.
* you ca also write <p> tag instead of <div> tag.

* What if you don't want <div> or <p> tag ::??


-> If you don't want any error even after having multiple components then you use
React fragments i.e empty open and closed tag
<>....<>

COMMENTS-
* inside return - {/*......*/} shortcut key- Ctrl + slash
* outside return - //

import "./styles.css";

function App() {
return (
<p>
<h1> Hoiii world </h1>
<h2> I m pretty better in doing work</h2>
</p>
);
}
export default App;

You might also like