-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
.children() are empty when a component doesn't wrap its children #696
Comments
When you say |
@ljharb Sorry, I see how that is misleading. I updated the description to clearly describe it as |
Does this same thing happen with |
I've just tested it with class Wrapper extends React.Component {
render() {
return React.Children.only(this.props.children);
}
}
const wrapper = shallow(
React.createElement(Wrapper, {}, React.createElement('div'))
);
expect(wrapper.children().length).toBe(1); and it fails (expects |
Does anyone have an update on this or any idea how we can fix it? |
Related to #977? |
I don't think this is still an issue in v3; please file a new issue if that's not the case. |
I have a
Localize
component that is used with the app as its single child and providescontext
to it. The relevant part is:When I
mount
this component and try to get.children()
, I get nothing.I can get the wrapper for the child component if I do this:
The text was updated successfully, but these errors were encountered: