<html>

<head>
  <title>Introduction to React</title>
  <!-- import React as dependency -->
  <script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
  <!-- import ReactDOM as dependency -->
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
  <!-- import Babel -->
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>

<body>
  <!-- container to render React -->
  <div id="root"></div>

  <script type="text/babel">
    // Component code goes here

    const Today = () => {
      const date = new Date();
      return (
        <h4>
          Today is {date.toLocaleDateString()} and local time is{" "}
          {date.toLocaleTimeString()}
        </h4>
      );
    };

    const Greet = (props) => {
      return (
        <div>
          <h1>Hello {props.user}</h1>
          <Today />
        </div>
      );
    };

    const App = () => {
      return (
        <React.Fragment>
          <Greet user="Gulshan Saini" />
          <Greet user="John Doe" />
        </React.Fragment>
      );
    };

    // Render function to display element on UI
    ReactDOM.render(<App />, document.getElementById("root"));
  </script>
</body>

</html>
body {
  font-family: sans-serif;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.