3 ms·
TL;DR -- it uses `instanceof`
by danschumann 8y ago
TL;DR -- it uses `instanceof`
- awestroke 8y agoWrong, try again.
- shawn 8y agoJoy. We've gone from "Please don't post TL;DRs" to "Please at least be correct."
- pookeh 8y agoYou 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.