(children, newProps)
| 224 | } |
| 225 | |
| 226 | mapChildrenToProps(children, newProps) { |
| 227 | let arrayTypeChildren = {}; |
| 228 | |
| 229 | React.Children.forEach(children, child => { |
| 230 | if (!child || !child.props) { |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | const {children: nestedChildren, ...childProps} = child.props; |
| 235 | const newChildProps = convertReactPropstoHtmlAttributes( |
| 236 | childProps |
| 237 | ); |
| 238 | |
| 239 | this.warnOnInvalidChildren(child, nestedChildren); |
| 240 | |
| 241 | switch (child.type) { |
| 242 | case TAG_NAMES.LINK: |
| 243 | case TAG_NAMES.META: |
| 244 | case TAG_NAMES.NOSCRIPT: |
| 245 | case TAG_NAMES.SCRIPT: |
| 246 | case TAG_NAMES.STYLE: |
| 247 | arrayTypeChildren = this.flattenArrayTypeChildren({ |
| 248 | child, |
| 249 | arrayTypeChildren, |
| 250 | newChildProps, |
| 251 | nestedChildren |
| 252 | }); |
| 253 | break; |
| 254 | |
| 255 | default: |
| 256 | newProps = this.mapObjectTypeChildren({ |
| 257 | child, |
| 258 | newProps, |
| 259 | newChildProps, |
| 260 | nestedChildren |
| 261 | }); |
| 262 | break; |
| 263 | } |
| 264 | }); |
| 265 | |
| 266 | newProps = this.mapArrayTypeChildrenToProps( |
| 267 | arrayTypeChildren, |
| 268 | newProps |
| 269 | ); |
| 270 | return newProps; |
| 271 | } |
| 272 | |
| 273 | render() { |
| 274 | const {children, ...props} = this.props; |
no test coverage detected