Просмотр исходного кода

fix component Children map error (#368)

陈帅 8 лет назад
Родитель
Сommit
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) {
     if (!children) {
       return null;
       return null;
     }
     }
-    const panes = children.map((child) => {
+    const panes = React.Children.map(children, (child) => {
       const title = child.props.list && child.props.list.length > 0
       const title = child.props.list && child.props.list.length > 0
         ? `${child.props.title} (${child.props.list.length})` : child.props.title;
         ? `${child.props.title} (${child.props.list.length})` : child.props.title;
       return (
       return (