-
Notifications
You must be signed in to change notification settings - Fork 47k
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
ReactShallowRenderer.render returns the rendered output #5411
Conversation
I don't think we have any chaining APIs at the moment and I'm not sure it's worth the inconsistency to add one now. cc @spicyj @sebmarkbage who have more knowledge on the shallow renderer |
Maybe cc @graue that might remember why we didn't. |
cc @sebmarkbage who merged #4918 which added |
cc @zpao who commented twice on this issue |
We have fun 😂 (sorry to distract from the main reason we're all here, which is to review this pull request) |
cc @zpao who didn't realize that #4918 added @simonewebdesign Would you prefer if it just returned |
8fa5cfe
to
c8b8c81
Compare
@simonewebdesign updated the pull request. |
@sebmarkbage I agree on that, the API would be more straightforward. |
Definitely like this change! @jsdf and @glenjamin either of you have concerns on this and how it could effect shallow rendering testing libraries? |
Seems safe enough to me, as mentioned this should be the most common case. |
ReactShallowRenderer.render returns the rendered output
Thanks! |
I think would be nice to be able to chain functions this way:
This is not possible at the moment, as
render()
doesn't return itself, so I have to do it in two lines: