Skip to content

Commit f2d8b7c

Browse files
authored
feat: update demo (#420)
1 parent 58be061 commit f2d8b7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/examples/change.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Demo() {
3232
};
3333

3434
const onSwitch = () => {
35-
this.setState(p => !p);
35+
setOpen(c => !c);
3636
}
3737

3838
return (
@@ -123,7 +123,7 @@ function Demo() {
123123
lineHeight: '24px',
124124
}}
125125
>
126-
{!this.state.open ? '打开' : '关闭'}
126+
{!open ? '打开' : '关闭'}
127127
</button>
128128
</div>
129129
</div>

0 commit comments

Comments
 (0)