Skip to content

Commit

Permalink
refactor(createEffectWithTarget): the first parameter is old-deps (#2431
Browse files Browse the repository at this point in the history
)
  • Loading branch information
coding-ice committed Mar 13, 2024
1 parent 866087a commit 43d3ae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hooks/src/utils/createEffectWithTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const createEffectWithTarget = (useEffectType: typeof useEffect | typeof useLayo

if (
els.length !== lastElementRef.current.length ||
!depsAreSame(els, lastElementRef.current) ||
!depsAreSame(deps, lastDepsRef.current)
!depsAreSame(lastElementRef.current, els) ||
!depsAreSame(lastDepsRef.current, deps)
) {
unLoadRef.current?.();

Expand Down

0 comments on commit 43d3ae8

Please sign in to comment.