Last active
January 26, 2018 11:48
-
-
Save jbardon/757a4901520ca9cb69edd24933d1c3cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <DatePicker handleDateSelected={this.handleDateSelected}/>; | |
} | |
} | |
export const DatePickerContainer = connect(mapStateToProps, mapDispatchToProps)(DatePickerController); | |
ReactDOM.render( | |
<DatePickerContainer/>, | |
document.getElementById('app') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment