React Functional Component

RMAG news
import React from “react”

const App = () => {
return (
<>
<h1>Hello World</h1>
<h1>Hi</h1>
</>
);
};

export default App;

Importing React is a good practice.
Functional component should always return(<>…</>) something and only 1 thing.
For the above reason even when we have 2 h1 tags we wrap them around in a fragment to return it as a single component.

Leave a Reply

Your email address will not be published. Required fields are marked *