-
Notifications
You must be signed in to change notification settings - Fork 45.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require instantiable components to extend React.Component #4663
Conversation
This almost works, except MockedComponent here doesn't end up with the flag:
@sebmarkbage ideas? |
If you use an object, jest will mock it. You would potentially set it to an object during DEV or testing maybe? |
5261d02
to
580cf7c
Compare
Fixed by changing isReactClass to not have an underscore… |
580cf7c
to
0ce1980
Compare
Another thing we could do is: element.type.prototype instanceof React.Component That locks it into a by-reference equality (and therefore a single |
Multiple React packages means it's likely they'll be different versions, so that's probably preferable? Mixing React packages seems like a bad idea (or a mistake) and being slapped with an error seems beneficial I would think. |
I like |
I thought the whole point (one of the whole points) of 0.14 (0.15 maybe) was that you can use more than one React. |
@spicyj But not mixing between them I would assume? |
@spicyj You can use more than one react-renderer without using more than one react-core. |
0ce1980
to
f3b7749
Compare
Require instantiable components to extend React.Component
Fixes #4599.