-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
General Information
- Bug
- Improvement
- Feature
- Other
Description
For simply use state properties.
@component()
export default class Hello extends Component<{name: string}, any> {
@state()
name = this.props.name;
@state()
age: number = 20;
render() {
console.log("render hello");
return (
<div>
Hello {this.name}, age: {this.age}
<br />
<button onClick={this.handleClick}>Incr age</button>
</div>
);
}
private handleClick = () => {
this.age++;
};
}Steps to reproduce
https://codesandbox.io/s/provider-a-state-property-decorator-r8yh3
Metadata
Metadata
Assignees
Labels
No labels