You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @JasinYip,
I've reproduced this issue and it seems that there are some problems with the constructor. I have to do more tests and find a solution.
I think that at the moment, in your case, you can do something like this:
import{autobind,component}from'react-decoration'
@componentclassCounter{constructor(){this.state={val: 2}}// or without constructor:// state = {// val: 2// }render(){return(<divonClick={this.increment}>{this.state.val}</div>)}
@autobindincrement(){this.setState({val: this.state.val+1})}}exportdefaultCounter
General Information
Description
I'm trying to use
@component
decorator and it shows this error.Steps to reproduce
Versions
2.0.0
The text was updated successfully, but these errors were encountered: