Answer the question
In order to leave comments, you need to log in
Event not working correctly?
class AddInfo extends Component{
state={
addText:false
}
render() {
const {classes}=this.props
const newStyles=injectSheet(styles)(AddInfo)
const inState= this.state.addText?'true':'false'
return (
<div>
<input type="text" className={classes.positionForm} onChange={this.addEvent}/>
{inState}
</div>
);
}
addEvent=()=>{
this.setState({
addText:!this.state.addText
})
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question