Skip to content

Commit 22ad127

Browse files
committed
fix non panel items in children has unexpected props
close ant-design/ant-design#20479
1 parent ab746b9 commit 22ad127

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-collapse",
3-
"version": "1.11.7",
3+
"version": "1.11.8",
44
"description": "rc-collapse ui component for react",
55
"keywords": [
66
"react",

src/Collapse.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ class Collapse extends Component {
9494
expandIcon,
9595
};
9696

97+
// https://github.com/ant-design/ant-design/issues/20479
98+
if (typeof child.type === 'string') {
99+
return child;
100+
}
101+
97102
return React.cloneElement(child, props);
98103
};
99104

0 commit comments

Comments
 (0)