Skip to content

Conversation

@acdlite
Copy link
Collaborator

@acdlite acdlite commented Oct 18, 2018

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

@sizebot
Copy link

sizebot commented Oct 18, 2018

Details of bundled changes.

Comparing: b738ced...ba8dee7

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

Copy link
Collaborator

@sebmarkbage sebmarkbage left a 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
@acdlite acdlite force-pushed the only-capture-if-fallback-defined branch from 45df778 to b395c49 Compare October 18, 2018 23:06
@acdlite acdlite merged commit 8ced545 into facebook:master Oct 18, 2018
if (!didTimeout) {
const fallback = workInProgress.memoizedProps.fallback;
const didTimeout = workInProgress.memoizedState;
if (!didTimeout && workInProgress.memoizedProps.fallback !== undefined) {
Copy link
Contributor

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.

Copy link
Collaborator

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.

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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants