I am getting the following error
Uncaught TypeError: Cannot read property \'setState\' of undefined
even after binding delta in
This error can be resolved by various methods-
If you are using ES5 syntax, then as per React js Documentation you have to use bind method.
Something like this for the above example:
this.delta = this.delta.bind(this)
If you are using ES6 syntax,then you need not use bind method,you can do it with something like this:
delta=()=>{
this.setState({
count : this.state.count++
});
}