-
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
Update test renderer to support new types of work #12237
Update test renderer to support new types of work #12237
Conversation
Adds support for ContextProvider, ContextConsumer, and Mode.
@@ -366,6 +369,9 @@ function toTree(node: ?Fiber) { | |||
case HostText: | |||
return node.stateNode.text; | |||
case Fragment: | |||
case ContextProvider: | |||
case ContextConsumer: | |||
case Mode: |
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.
I'm treating these as fragments right now because I'm not really sure how this output is consumed. Should I create a new nodeType
?
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 nodeType
is only used for user-defined components and host components. Everything else is treated as a pass-through.
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.
This looks good to me.
I'm going to merge this so we can unblock some internal teams that are using the new context API. @ljharb and @lelandrichardson let me know if there are additional follow-up items. |
Adds support for ContextProvider, ContextConsumer, and Mode.
Adds support for ContextProvider, ContextConsumer, and Mode.
Adds support for ContextProvider, ContextConsumer, and Mode.
Closes #12150