Skip to content

Fix ReactTestUtils.isCompositeComponent#3839

Closed
koba04 wants to merge 1 commit intofacebook:masterfrom
koba04:fix-testutils-is-composite-component
Closed

Fix ReactTestUtils.isCompositeComponent#3839
koba04 wants to merge 1 commit intofacebook:masterfrom
koba04:fix-testutils-is-composite-component

Conversation

@koba04
Copy link
Copy Markdown
Contributor

@koba04 koba04 commented May 8, 2015

Currentry, ReactTestUtils.isCompositeComponent returns true even if passed a DOMComponent.

ReactTestUtils.isCompositeComponent(ReactTestUtils.renderIntoDocument(<div/>)); // true

This is for fixing that.
I think every Component except DOMComponent is CompositeComponent. Is it correct?

@sebmarkbage
Copy link
Copy Markdown
Contributor

No, there are also React ART Components, React Native Components etc.

This is also not verifying that it is indeed a component at all, any random object or string or null would pass.

The problem right now is that React DOM components are wrapped in composites. We're planning on changing that and just returning the straight up DOM node.

@koba04 koba04 force-pushed the fix-testutils-is-composite-component branch from fb89433 to 9bd3374 Compare May 14, 2015 12:38
@koba04 koba04 force-pushed the fix-testutils-is-composite-component branch from 9bd3374 to 994fec4 Compare May 14, 2015 12:56
@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented May 14, 2015

@sebmarkbage

Thank you for your feedback!

I've fixed problems in your feedback.

The problem right now is that React DOM components are wrapped in composites. We're planning on changing that and just returning the straight up DOM node.

Even if React DOM Components are not wrapped in composites, !inst.tagName is required for React ART Components (React Native Components too?).

@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented May 23, 2015

This PR is not fixed all issues completely and is just a workaround.
But I think this should be applied because current implementation is quite not working...

@koba04 koba04 force-pushed the fix-testutils-is-composite-component branch from 994fec4 to b670ef8 Compare August 5, 2015 10:35
@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented Aug 5, 2015

@sebmarkbage
In v0.14.0-beta3, This issue is fixed. Thanks!
But an error occurred when it's passed null.
I fixed it.

@sebmarkbage sebmarkbage added this to the 0.15 milestone Oct 6, 2015
@sophiebits
Copy link
Copy Markdown
Collaborator

I actually ended up fixing this in #5016 so we don't need to take this. Thanks for looking into it.

@sophiebits sophiebits closed this Oct 7, 2015
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.

5 participants