Skip to content

Commit bdea3dc

Browse files
jackpopegnoff
andauthored
Apply suggestions from code review
Co-authored-by: Josh Story <[email protected]>
1 parent 9e41412 commit bdea3dc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/react-reconciler/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,23 +320,27 @@ This method should mutate the `container` root node and remove all children from
320320

321321
#### `maySuspendCommit(type, props)`
322322

323-
This method should determine if this combination of type and props may need to suspend.
323+
This method is called during render to determine if the Host Component type and props require some kind of loading process to complete before committing an update.
324324

325325
#### `preloadInstance(type, props)`
326326

327-
This method should kick off any preloading of resources required. Return `true` to indicate it's already loaded or `false` to trigger a fallback.
327+
This method may be called during render if the Host Component type and props might suspend a commit. It can be used to initiate any work that might shorten the duration of a suspended commit.
328328

329329
#### `startSuspendingCommit()`
330330

331-
This method begins Suspense on something that isn't associated with a particular node.
331+
This method is called just before the commit phase. Use it to set up any necessary state while any Host Components that might suspend this commit are evaluated to determine if the commit must be suspended.
332332

333333
#### `suspendInstance(type, props)`
334334

335-
This method prevents a tree from being displayed without blocking the components from being evaluated. Consider it Suspense for the commit phase.
335+
This method is called after `startSuspendingCommit` for each Host Component that indicated it might suspend a commit.
336336

337337
#### `waitForCommitToBeReady()`
338338

339-
This method determines if the renderer is ready to commit or if React should suspend. If it is not ready, return a callback to subscribe to a ready event.
339+
This method is called after all `suspendInstance` calls are complete.
340+
341+
Return `null` if the commit can happen immediately.
342+
343+
Return `(initiateCommit: Function) => Function` if the commit must be suspended. The argument to this callback will initiate the commit when called. The return value is a cancellation function that the Reconciler can use to abort the commit.
340344

341345
### Persistence Methods
342346

0 commit comments

Comments
 (0)