I am working on a Reactjs application, and want to update state using
this.setState({})
But its saying cannot read property of "setState" is undefined.
Here is my Code.
constructor(props) {
super(props)
this.state = {
volume: 0
}
this.handleOnChange = this.handleOnChange.bind(this);
}
handleOnChange(value) {
this.setState({
volume: value
})
}
Error: Uncaught TypeError: Cannot read property 'setState' of undefined.