I am getting the following error
Uncaught TypeError: Cannot read property \'setState\' of undefined
even after binding delta in
you have to bind new event with this keyword as i mention below...
class Counter extends React.Component {
constructor(props) {
super(props);
this.state = {
count : 1
};
this.delta = this.delta.bind(this);
}
delta() {
this.setState({
count : this.state.count++
});
}
render() {
return (
{this.state.count}
);
}
}