this.overlay.addEventListener('click',()=>this.hide);
попробуйте так maxDate={needDefaultValue===true?new Date:''}
{needDefaultValue===true?
<Datepicker
maxDate={new Date()}
/>
:
<Datepicker
/>}
<input
defaultValue={needDefaultValue===true?needDefaultValue:null}
></input>
class Login extends Component {
constructor(props) {
super();
this.state = ({
});
}
render() {
return (
<div>
<div style={mainDiv}>
<img src="./img/da-systems.png" alt="" style={imageWidthHeight}/>
<div style={styles.myWidth}>
<Checkbox
label="Gegevens onthouden"
style={styles.checkbox}
onCheck={this.rememberMe.bind(this)}
checked={this.state.rememberMe}
/>
</div>
<RaisedButton label="LOG IN" primary={true} fullWidth={true} onClick={this.logIn.bind(this)}/>
</div>
<Snackbar
open={this.state.open}
message="Geen netwerkverbinding"
autoHideDuration={4000}
onRequestClose={this.handleRequestClose}
/>
</div>
)
}
}
const styles = {
block: {
maxWidth: 250,
},
checkbox: {
marginBottom: 16,
width: '100%',
},
div: {
display: 'flex',
flexDirection: 'column',
padding: 20,
width: '100%',
},
paperLeft: {
flex: 1,
height: '100%',
margin: 10,
textAlign: 'center',
padding: 10
},
paperRight: {
height: 600,
flex: 4,
margin: 10,
textAlign: 'center',
},
myWidth: {
width: '100%',
display: 'flex',
marginTop: '15px',
marginBottom: '15px',
}
};
const imageWidthHeight = {
marginTop:'25px',
maxWidth: '130px',
}
const mainDiv = {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
marginLeft: '25px',
marginRight: '25px',
}
export default Login
Вы копаете в правильном направлении
вот пример