-
-
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
[Fix] {ShallowWrapper,ReactWrapper}#{type,props}()
should work with null
nodes
#162
Conversation
…er#props()` should work with `null` nodes. Fixes #113.
return this.single(n => getNode(n).props || {}); | ||
return this.single((n) => { | ||
const node = getNode(n); | ||
return node ? node.props || {} : {}; |
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 think in the Utils file there is a propsOfNode
function that we should probably be using instead of this. It deals with things like null being passed in.
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.
Sounds good - will that work the same in shallow and mount?
c7d0670
to
198db6c
Compare
[Fix] `{ShallowWrapper,ReactWrapper}#{type,props}()` should work with `null` nodes
@ljharb I'm wondering -- why would we want wrappers with null nodes to get passed to |
That's a good point, and may be an alternative approach. |
Yeah I was going to post an issue about |
Let's do that - findWhere and filterWhere etc perhaps shouldn't return |
Okay, sounds good |
And thanks for this awesome project! |
Fixes #113.
^ @lelandrichardson, @goatslacker