Skip to content

Commit

Permalink
fix: check other props for react state change (#906)
Browse files Browse the repository at this point in the history
* fix: check other props for react state change

* refactor: compare child and nextChild on hasSameChildren
  • Loading branch information
malangfox authored Jan 2, 2025
1 parent 0ebc9ff commit 6c07725
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;
} else {
return child === nextChild;
}
return child === nextChild;
});

return same;
Expand Down

0 comments on commit 6c07725

Please sign in to comment.