I have the next code:
close = () => {
this.setState({ open: false });
this.props.onUpdate(this.props.defaultValue);
}
But I am getting the next error message:
ERROR in ./ui/usersModule/scripts/usersTable.jsx
Module build failed: SyntaxError:
Error: Unexpected token (232:8)
230 | }
231 |
> 232 | close = () => {
| ^
233 | this.setState({ open: false });
234 | this.props.onUpdate(this.props.defaultValue);
235 | }
I saw that it compiles on the original code but for some reason it does not compile in my machine. I need to call it from:
onClick={ this.close }
Why could be my error? is there another way to call that close function?