Skip to content

Commit 6c07725

Browse files
authored
fix: check other props for react state change (#906)
* fix: check other props for react state change * refactor: compare child and nextChild on hasSameChildren
1 parent 0ebc9ff commit 6c07725

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/react-flicking/src/react-flicking/Flicking.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,7 @@ class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>>
266266
const same = prevChildren.every((child, idx) => {
267267
const nextChild = nextChildren[idx];
268268

269-
if (child.key && nextChild.key) {
270-
return child.key === nextChild.key;
271-
} else {
272-
return child === nextChild;
273-
}
269+
return child === nextChild;
274270
});
275271

276272
return same;

0 commit comments

Comments
 (0)