Development Environment for React

// working code
import React from "react";
import ReactDom from "react-dom";

function Greeting() {
  return (
    <section>
      <Person />
      <Message />
    </section>
  );
}

// create seprate reuseable components as many as you want and nest them in the root component that is being rendered in index.html
const Person = () => <h1>Ahmad Hassan Khan</h1>;
const Message = () => <h2> Message from sample application</h2>;

ReactDom.render(<Greeting></Greeting>, document.getElementById("root"));
Previous
Next