0

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.

giuseppedeponte
  • 2,366
  • 1
  • 9
  • 19
Jagdeesh Kumar
  • 1,640
  • 2
  • 13
  • 29

0 Answers0