3 ms·
You probably need to continue reading the post :) > That’s not what React does though. > > One caveat to the instanceof solution is that it doesn’t work
by pookeh 8y ago
You probably need to continue reading the post :)
> That’s not what React does though.
>
> One caveat to the instanceof solution is that it doesn’t work when there are multiple copies of React on the page, and the component we’re checking inherits from another React copy’s React.Component.
Real TL;DR:
> If you don’t extend React.Component, React won’t find isReactComponent on the prototype, and won’t treat component as a class.