You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-reconciler/README.md
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -320,23 +320,27 @@ This method should mutate the `container` root node and remove all children from
320
320
321
321
#### `maySuspendCommit(type, props)`
322
322
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.
324
324
325
325
#### `preloadInstance(type, props)`
326
326
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.
328
328
329
329
#### `startSuspendingCommit()`
330
330
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.
332
332
333
333
#### `suspendInstance(type, props)`
334
334
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.
336
336
337
337
#### `waitForCommitToBeReady()`
338
338
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.
0 commit comments