Screen Shot 2017-08-28 at 4.28.46 PM.png

import React, { Component } from 'react';

function Clock(props) {
  return (
    <div>
      <h1>Hello, world!</h1>
      <h2>It is {props.date.toLocaleTimeString()}.</h2>
    </div>
  );
}

class App extends Component {
  render() {
    return (
      <Clock date={new Date()} />
    );
  }
}

export default App;
Advertisements