Closed dferber90 closed 5 years ago
I moved the declaration to module scope now (amended the commit) and added a test for objects with a hasOwnProperty
property.
Thanks for this fix! Running into this as well. Is there a reason it sits open?
@mhuggins It is ready to be merged from my side (aside from the merge conflicts now).
Rebased this; it's partially addressed by #112 but still includes tests and a fix.
Thanks, guys! ❤️
Avoids the
Warning: Failed prop type: propValue.hasOwnProperty is not a function
warning whenhasOwnProperty
is not defined in the prototype chain.See #183 for details.
delete Object.prototype.hasOwnProperty
being a thing. I did not quite get this comment, so this solution might not work because of that. Just close this PR in that case.PropTypes.shape({ q: PropTypes.objectOf(PropTypes.string) })
I pointed out in https://github.com/facebook/prop-types/issues/183#issuecomment-392545102, as I didn't know where to place them