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

Update test renderer to support new types of work #12237

Merged
merged 1 commit into from
Feb 16, 2018

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Feb 16, 2018

Adds support for ContextProvider, ContextConsumer, and Mode.

Closes #12150

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:
Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

@bvaughn bvaughn left a 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.

@acdlite
Copy link
Collaborator Author

acdlite commented Feb 16, 2018

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.

@acdlite acdlite merged commit e68c016 into facebook:master Feb 16, 2018
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
Adds support for ContextProvider, ContextConsumer, and Mode.
NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
Adds support for ContextProvider, ContextConsumer, and Mode.
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.

3 participants