Skip to content
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

Support Suspense in shallow renderer #14638

Closed
wants to merge 1 commit into from

Conversation

chenesan
Copy link
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
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.

None yet

2 participants