Hi, I need your help. Not sure what is wrong here. I have tried many times and I get at least 1 error
My App.js is next:
import React from 'react';
class App extends React.Component {
state = {
currentValue: 0,
};
updateValue = () => {
const { currentValue } = this.state;
this.setState({
currentValue: currentValue + 1,
});
};
shouldComponentUpdate(nextState, nextProps) {
const { currentValue } = this.state;
if (currentValue > 3) {
return true;
} else {
return false;
}
}
render() {
const { currentValue } = this.state;
return (
<div>
<h4>Current value: {currentValue}</h4>
<button onClick={this.updateValue}>Update</button>
</div>
);
}
}
export default App;