Skip to content

Commit

Permalink
upgrade docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbFlying committed Jan 30, 2024
1 parent 4073769 commit 48de360
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function App() {
return (
<>
{count}
<button onClick={() => store.count++}>+</button>
<button onClick={() => store.count++}>increase</button>
</>
);
}
Expand All @@ -55,7 +55,15 @@ class AppClass extends ComponentWithStore {
return (
<>
{count}
<button onClick={() => this.store.count++}>+</button>
<button onClick={() => {
store.count++;
/**
* @description You can also use `this` to access the store,
* which in essence is equivalent to operating directly through the store.
* Generally, we would not perform such redundant operations.
*/
// this.store.count++;
}}>increase</button>
</>
);
}
Expand Down

0 comments on commit 48de360

Please sign in to comment.