Create React Components

(App component)

App.js

import React from "react";
import "./App.css";

function Header() {
  return (
    <header>
      <h1>Sarker's Food</h1>
    </header>
  );
}

function Main() {
  return (
    <section>
      <p>The most delicious and healthy food.</p>
    </section>
  );
}

function Footer() {
  return (
    <footer>
      <h6>@copyright Joyeeta Nandi 2021</h6>
    </footer>
  );
}

function App() {
  return (
    <div className="App">
      <Header />
      <Main />
      <Footer />
    </div>
  );
}

export default App;

index.js

import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";

ReactDOM.render(
  <App />,
  document.getElementById("root")
);

Output:

image.png

No Comments Yet