Skip to content

Commit

Permalink
Don't run the effect the first time. Return early. (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
dompuiu authored May 30, 2024
1 parent 9a8c855 commit d808441
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/view/utils/useChanged.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const useChanged = (effect, dependencies) => {
useEffect(() => {
if (isFirstRenderRef.current) {
isFirstRenderRef.current = false;
return;
}
effect();
}, dependencies);
Expand Down

0 comments on commit d808441

Please sign in to comment.