Skip to content

Commit

Permalink
fix: fix count don't work (#1784)
Browse files Browse the repository at this point in the history
* fix: fix count
  • Loading branch information
li-jia-nan authored Jul 27, 2022
1 parent 8244516 commit 0278f9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hooks/src/useMutationObserver/demo/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const App: React.FC = () => {

useMutationObserver(
(mutationsList) => {
mutationsList.forEach(() => setCount(count + 1));
mutationsList.forEach(() => setCount((c) => c + 1));
},
ref,
{ attributes: true },
Expand Down

0 comments on commit 0278f9b

Please sign in to comment.