Skip to content

Support Suspense in shallow renderer#14638

Closed
chenesan wants to merge 1 commit intofacebook:masterfrom
chenesan:shallow-render-suspense
Closed

Support Suspense in shallow renderer#14638
chenesan wants to merge 1 commit intofacebook:masterfrom
chenesan:shallow-render-suspense

Conversation

@chenesan
Copy link
Copy Markdown
Contributor

Try to support Suspense in shallow renderer, which may partially solve #14170 . Also in enzymejs/enzyme#1975 I'm trying to add support of Suspense and Lazy but stuck with that shallow renderer not support it.

I know this is arguable - or even not make sense - to shallow render Suspense. But, in some of use cases people would be like to know what's rendering in one layer down of Suspense (like wrapper.dive), so I think it's still valuable.

Currently in the PR I haven't handled the fallback and lazy, just plainly return children under Suspense. I'm not sure if it's good to handle fallback - find all the lazy component under Suspense and render it and wait for thenable resolve to update, which is complicated in fiber implementaion - in shallow rendering. I think it would be great for testing to have a simpler implementation, but not sure if there is other consideration here.

@chenesan
Copy link
Copy Markdown
Contributor Author

Closed. See discussion in enzymejs/enzyme#1975 .

@chenesan chenesan closed this Jan 29, 2019
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.

2 participants