tcomb-react icon indicating copy to clipboard operation
tcomb-react copied to clipboard

Should an `undefined` propType value be ignored by strict check

Open tdreyno opened this issue 8 years ago • 0 comments

Hi all, I'm using Preact which seems to pass the prop children={undefined} when there are no component children, rather than omitting the prop key entirely.

This means I have to add t.maybe(ReactChildren) to all of my propTypes to avoid errors.

I get why the behavior is the way it is, since an undefined value is not necessarily the same as a missing value. I get why that is correct, especially some a type system perspective.

But... do you think it'd be reasonable in this context (propTypes) to not trigger strict errors on undefined values?

Thanks!

tdreyno avatar Apr 04 '17 00:04 tdreyno