Closed majapw closed 7 years ago
I've noticed this behaviour in my own app.
Confirmed. I'll fix the behavior as soon as I have some free time to work on it (likely by Saturday).
Thanks @CalebMorris! Let me know how I can help. :)
Added this behavior in v1.4.0
.
2 things to note with this change.
isRequired
warning now matches the common React PropTypes for this behavior.<Foo bar={undefined}
failing in console, but not browser).
Hi @CalebMorris! I tested this by cloning your repository and making some modifications to your test suite.
Basically, in your
isRequired
test formomentObj
, you have the following:Which of course, does what you expect it to and raises a warning. However, when you change the test element to be
<TestClass testRequiredObject={null} />
or<TestClass testRequiredObject={undefined} />
, you find that the test no longer raises an warning even though I would expect it to.FYI: @ljharb