Skip to content

Commit 34308b5

Browse files
authored
Tidy up early bailout logic at start of begin phase (#21852)
* Extract early bailout to separate function This block is getting hard to read so I moved it to a separate function. I'm about to refactor the logic that wraps around this path. Ideally this early bailout path would happen before the begin phase phase. Perhaps during reconcilation of the parent fiber's children. * Extract state and context check to separate function The only reason we pass `updateLanes` to some begin functions is to check if we can perform an early bail out. But this is also available as `current.lanes`, so we can read it from there instead. I think the only reason we didn't do it this way originally is because components that have two phases — error and Suspense boundaries — use `workInProgress.lanes` to prevent a bail out, since during the initial render there is no `current`. But we can check the `DidCapture` flag instead, which we use elsewhere to detect the second phase.
1 parent d9dd965 commit 34308b5

File tree

4 files changed

+520
-490
lines changed

4 files changed

+520
-490
lines changed

0 commit comments

Comments
 (0)