Skip to content

Commit 56af391

Browse files
author
yangpj17
committed
fix: only pass key if child is Fragment
1 parent 0cf9987 commit 56af391

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CSSMotionList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ export function genCSSMotionList(
130130

131131
const Component = component || React.Fragment;
132132
const motionProps = pick(restProps, MOTION_PROP_NAMES as any);
133-
const componentProps = omit(restProps, MOTION_PROP_NAMES as any);
133+
const componentProps = component
134+
? pick(restProps, ['key'] as any)
135+
: omit(restProps, [...MOTION_PROP_NAMES, 'keys'] as any);
134136

135137
return (
136138
<Component {...componentProps}>

0 commit comments

Comments
 (0)