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.
Pass in anything that's not a React Component to
addInputType, and no exceptions will be thrown.One issue is that
!has higher precedence thaninstanceof. So, inaddInputType, the line:!React.Component instanceof instance.constructoris actually negating
React.Component, not the result of theinstanceoftest.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.