( rootFiber: Fiber, lane: Lane, element: ReactNodeList, container: OpaqueRoot, parentComponent: ?component(...props: any), callback: ?Function, )
| 394 | } |
| 395 | |
| 396 | function updateContainerImpl( |
| 397 | rootFiber: Fiber, |
| 398 | lane: Lane, |
| 399 | element: ReactNodeList, |
| 400 | container: OpaqueRoot, |
| 401 | parentComponent: ?component(...props: any), |
| 402 | callback: ?Function, |
| 403 | ): void { |
| 404 | if (__DEV__) { |
| 405 | onScheduleRoot(container, element); |
| 406 | } |
| 407 | |
| 408 | if (enableSchedulingProfiler) { |
| 409 | markRenderScheduled(lane); |
| 410 | } |
| 411 | |
| 412 | const context = getContextForSubtree(parentComponent); |
| 413 | if (container.context === null) { |
| 414 | container.context = context; |
| 415 | } else { |
| 416 | container.pendingContext = context; |
| 417 | } |
| 418 | |
| 419 | if (__DEV__) { |
| 420 | if ( |
| 421 | ReactCurrentFiberIsRendering && |
| 422 | ReactCurrentFiberCurrent !== null && |
| 423 | !didWarnAboutNestedUpdates |
| 424 | ) { |
| 425 | didWarnAboutNestedUpdates = true; |
| 426 | console.error( |
| 427 | 'Render methods should be a pure function of props and state; ' + |
| 428 | 'triggering nested component updates from render is not allowed. ' + |
| 429 | 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + |
| 430 | 'Check the render method of %s.', |
| 431 | getComponentNameFromFiber(ReactCurrentFiberCurrent) || 'Unknown', |
| 432 | ); |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | const update = createUpdate(lane); |
| 437 | // Caution: React DevTools currently depends on this property |
| 438 | // being called "element". |
| 439 | update.payload = {element}; |
| 440 | |
| 441 | callback = callback === undefined ? null : callback; |
| 442 | if (callback !== null) { |
| 443 | if (__DEV__) { |
| 444 | if (typeof callback !== 'function') { |
| 445 | console.error( |
| 446 | 'Expected the last optional `callback` argument to be a ' + |
| 447 | 'function. Instead received: %s.', |
| 448 | callback, |
| 449 | ); |
| 450 | } |
| 451 | } |
| 452 | update.callback = callback; |
| 453 | } |
no test coverage detected