-
Notifications
You must be signed in to change notification settings - Fork 50k
Suspense component does not capture if fallback is not defined
#13879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspense component does not capture if fallback is not defined
#13879
Conversation
Details of bundled changes.Comparing: b738ced...ba8dee7 scheduler
Generated by 🚫 dangerJS |
sebmarkbage
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| if (!didTimeout) { | ||
| const fallback = workInProgress.memoizedProps.fallback; | ||
| const didTimeout = workInProgress.memoizedState; | ||
| if (!didTimeout && workInProgress.memoizedProps.fallback !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed this. Looks like an oversight that you read from workInProgress.memoizedProps.fallback twice rather than use the fallback const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this code already changed.
…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
…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
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