Invalid custom inputTypes are not rejected
Pass in anything that's not a React Component to addInputType, and no exceptions will be thrown.
One issue is that ! has higher precedence than instanceof. So, in addInputType, the line:
!React.Component instanceof instance.constructor
is actually negating React.Component, not the result of the instanceof test.
However, wrapping it in parentheses like !(React.Component instanceof instance.constructor) doesn't fix the overall issue, so I think there's something wrong with the instanceof test, too.
Ahh. This may have been a time thing, those validation checks have probably changed over time, and Winterfell hasn't kept up with that. I'll do some digging on this, and work out what the best validation check is.
Happy to accept PRs too! :)
I was going to submit a PR, but the handful of things I tried didn't work. I'm not too clear on how React's object hierarchy works under the hood, unfortunately. I've mostly left Javascript for Clojurescript these days, so my esoteric knowledge about Js prototype stuff is dwindling...