First of all, we should not store the ui components inside the state variable , the state should contain only data. All part of ui should be inside the method render.
render - , . this.state.loginButton, null, .
:
constructor(props) {
super(props)
this.state = {
loginButton: props.username,
benchmarkList: ''
}
}
render(){
return(
<div>
{!this.state.loginButton ? <GoogleButton></GoogleButton> : null}
</div>
)
}
props state , this.props.username, , .