Skip to content

Commit

Permalink
fix:element remove leak
Browse files Browse the repository at this point in the history
  • Loading branch information
zhourengui authored and zhourengui committed Sep 16, 2024
1 parent f6a1383 commit 580164b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/CSSMotionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,10 @@ export function genCSSMotionList(
const mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);

return {
keyEntities: mixedKeyEntities.filter(entity => {
const prevEntity = keyEntities.find(({ key }) => entity.key === key);

keyEntities: mixedKeyEntities.filter(
// Remove if already mark as removed
if (
prevEntity &&
prevEntity.status === STATUS_REMOVED &&
entity.status === STATUS_REMOVE
) {
return false;
}
return true;
}),
entity => entity.status !== STATUS_REMOVE,
),
};
}

Expand Down

0 comments on commit 580164b

Please sign in to comment.