Skip to content

Commit

Permalink
refactor: compare child and nextChild on hasSameChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
malangfox committed Dec 17, 2024
1 parent 9d06d5a commit 31c1e3a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/react-flicking/src/react-flicking/Flicking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,7 @@ class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>>
const same = prevChildren.every((child, idx) => {
const nextChild = nextChildren[idx];

if (child.key && nextChild.key) {
return child.key === nextChild.key && Object.keys(child.props).every(key => child.props[key] === nextChild.props[key]);
} else {
return child === nextChild;
}
return child === nextChild;
});

return same;
Expand Down

0 comments on commit 31c1e3a

Please sign in to comment.