When creating an HOC I'm not sure which kind of component will be wrapped, sometimes it is another React Component, sometimes it could be a plain DOM Element as li and a.
WrappedComp = myHOC(BaseComponent)
MyHOC will pass extra props to the wrapped component and in most of the cases this will work as it should.
But sometimes when BaseComponent is for example an li it will not accept the extra props and React will throw a warning Unkown Prop Warning saying that DOM element do not accept non-standard dom attributes: https://facebook.github.io/react/warnings/unknown-prop.html
So how could I check if BaseComponent is a DOM element or else? In case it is I will not pass the extra props to it.
Is there a better way to do this?
console.log(BaseComponent)?function, typeof(BaseComponent) == "function", as for HTML components, react uses astring.propTypesdefined.