<div id="app"></div>
const DatePicker = (props) => 
	<input type="date" onChange={props.handleDateSelected}/>;

class DatePickerController extends React.Component {
  constructor (props) {
    super(props);
    this.state = { currentDate: null };
    this.handleDateSelected = this.handleDateSelected.bind(this);
  }

  handleDateSelected ({target}) {
     this.setState({ currentDate: target.value });
  }

  render () { 
     return <React.Fragment>
     		<DatePicker handleDateSelected={this.handleDateSelected}/>
        <pre>State: {JSON.stringify(this.state)}</pre>
     </React.Fragment>;
  }
}

ReactDOM.render(
  <DatePickerController/>,
  document.getElementById('app')
);

/*
// With Redux as the state manager
export const DatePickerContainer = 
	connect(mapStateToProps, mapDispatchToProps)(DatePickerController);

ReactDOM.render(
  <DatePickerContainer/>,
  document.getElementById('app')
);
*/
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/react@16.2.0/umd/react.development.js
  2. https://unpkg.com/react-dom@16.2.0/umd/react-dom.development.js