Suspense component does not capture if fallback is not defined#13879
Merged
acdlite merged 2 commits intofacebook:masterfrom Oct 18, 2018
Merged
Suspense component does not capture if fallback is not defined#13879acdlite merged 2 commits intofacebook:masterfrom
fallback is not defined#13879acdlite merged 2 commits intofacebook:masterfrom
Conversation
Details of bundled changes.Comparing: b738ced...ba8dee7 scheduler
Generated by 🚫 dangerJS |
gaearon
reviewed
Oct 18, 2018
sebmarkbage
reviewed
Oct 18, 2018
sebmarkbage
approved these changes
Oct 18, 2018
Contributor
sebmarkbage
left a comment
There was a problem hiding this comment.
slight nit on the order of execution.
A missing fallback prop means the exception should propagate to the next parent (like a rethrow). That way a Suspense component can specify other props like maxDuration without needing to provide a fallback, too. Closes facebook#13864
45df778 to
b395c49
Compare
bvaughn
reviewed
Oct 19, 2018
| if (!didTimeout) { | ||
| const fallback = workInProgress.memoizedProps.fallback; | ||
| const didTimeout = workInProgress.memoizedState; | ||
| if (!didTimeout && workInProgress.memoizedProps.fallback !== undefined) { |
Contributor
There was a problem hiding this comment.
Just noticed this. Looks like an oversight that you read from workInProgress.memoizedProps.fallback twice rather than use the fallback const.
Collaborator
There was a problem hiding this comment.
Seems like this code already changed.
linjiajian999
pushed a commit
to linjiajian999/react
that referenced
this pull request
Oct 22, 2018
…ebook#13879) * Suspense component does not capture if `fallback` is not defined A missing fallback prop means the exception should propagate to the next parent (like a rethrow). That way a Suspense component can specify other props like maxDuration without needing to provide a fallback, too. Closes facebook#13864 * Change order of checks
3 tasks
jetoneza
pushed a commit
to jetoneza/react
that referenced
this pull request
Jan 23, 2019
…ebook#13879) * Suspense component does not capture if `fallback` is not defined A missing fallback prop means the exception should propagate to the next parent (like a rethrow). That way a Suspense component can specify other props like maxDuration without needing to provide a fallback, too. Closes facebook#13864 * Change order of checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A missing fallback prop means the exception should propagate to the next
parent (like a rethrow). That way a Suspense component can specify other
props like maxDuration without needing to provide a fallback, too.
Closes #13864
cc: @jaredpalmer