(returnFiber: Fiber, invalidChild: symbol)
| 377 | } |
| 378 | |
| 379 | function warnOnSymbolTypeImpl(returnFiber: Fiber, invalidChild: symbol) { |
| 380 | if (__DEV__) { |
| 381 | const parentName = getComponentNameFromFiber(returnFiber) || 'Component'; |
| 382 | |
| 383 | if (ownerHasSymbolTypeWarning[parentName]) { |
| 384 | return; |
| 385 | } |
| 386 | ownerHasSymbolTypeWarning[parentName] = true; |
| 387 | |
| 388 | // eslint-disable-next-line react-internal/safe-string-coercion |
| 389 | const name = String(invalidChild); |
| 390 | |
| 391 | if (returnFiber.tag === HostRoot) { |
| 392 | console.error( |
| 393 | 'Symbols are not valid as a React child.\n' + ' root.render(%s)', |
| 394 | name, |
| 395 | ); |
| 396 | } else { |
| 397 | console.error( |
| 398 | 'Symbols are not valid as a React child.\n' + ' <%s>%s</%s>', |
| 399 | parentName, |
| 400 | name, |
| 401 | parentName, |
| 402 | ); |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | function warnOnSymbolType(returnFiber: Fiber, invalidChild: symbol) { |
| 408 | const debugTask = getCurrentDebugTask(); |
no test coverage detected