(current, workInProgress, Component, nextProps, renderLanes)
| 19222 | } |
| 19223 | |
| 19224 | function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { |
| 19225 | // TODO: current can be non-null here even if the component |
| 19226 | // hasn't yet mounted. This happens after the first render suspends. |
| 19227 | // We'll need to figure out if this is fine or can cause issues. |
| 19228 | { |
| 19229 | if (workInProgress.type !== workInProgress.elementType) { |
| 19230 | // Lazy component props can't be validated in createElement |
| 19231 | // because they're only guaranteed to be resolved here. |
| 19232 | var innerPropTypes = Component.propTypes; |
| 19233 | |
| 19234 | if (innerPropTypes) { |
| 19235 | checkPropTypes(innerPropTypes, nextProps, // Resolved props |
| 19236 | 'prop', getComponentNameFromType(Component)); |
| 19237 | } |
| 19238 | } |
| 19239 | } |
| 19240 | |
| 19241 | var render = Component.render; |
| 19242 | var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent |
| 19243 | |
| 19244 | var nextChildren; |
| 19245 | var hasId; |
| 19246 | prepareToReadContext(workInProgress, renderLanes); |
| 19247 | |
| 19248 | { |
| 19249 | markComponentRenderStarted(workInProgress); |
| 19250 | } |
| 19251 | |
| 19252 | { |
| 19253 | ReactCurrentOwner$1.current = workInProgress; |
| 19254 | setIsRendering(true); |
| 19255 | nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); |
| 19256 | hasId = checkDidRenderIdHook(); |
| 19257 | |
| 19258 | if ( workInProgress.mode & StrictLegacyMode) { |
| 19259 | setIsStrictModeForDevtools(true); |
| 19260 | |
| 19261 | try { |
| 19262 | nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); |
| 19263 | hasId = checkDidRenderIdHook(); |
| 19264 | } finally { |
| 19265 | setIsStrictModeForDevtools(false); |
| 19266 | } |
| 19267 | } |
| 19268 | |
| 19269 | setIsRendering(false); |
| 19270 | } |
| 19271 | |
| 19272 | { |
| 19273 | markComponentRenderStopped(); |
| 19274 | } |
| 19275 | |
| 19276 | if (current !== null && !didReceiveUpdate) { |
| 19277 | bailoutHooks(current, workInProgress, renderLanes); |
| 19278 | return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); |
| 19279 | } |
| 19280 | |
| 19281 | if (getIsHydrating() && hasId) { |
no test coverage detected
searching dependent graphs…