소스 검색

fix component Children map error (#368)

陈帅 8 년 전
부모
커밋
1a65f5b395
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/components/NoticeIcon/index.js

+ 1 - 1
src/components/NoticeIcon/index.js

@@ -40,7 +40,7 @@ export default class NoticeIcon extends PureComponent {
     if (!children) {
       return null;
     }
-    const panes = children.map((child) => {
+    const panes = React.Children.map(children, (child) => {
       const title = child.props.list && child.props.list.length > 0
         ? `${child.props.title} (${child.props.list.length})` : child.props.title;
       return (