-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
ReactComponent.isValidComponent returns true for component classes #1164
Comments
This is an intermediate step. Currently the duck typing is flawed regardless. Descriptors will probably get an inheritance chain so that instanceof ReactDescriptor works as a safer check. Only descriptors should pass. We could probably check for props too. It is expected that component classes themselves fail the test. Therefore it should also be renamed. On Feb 24, 2014, at 7:42 AM, Ben Alpert notifications@github.com wrote:
|
Right -- with the current code, |
That's right. We should add that unit test. Out of curiosity, how did you find this? On Feb 24, 2014, at 1:51 PM, Ben Alpert notifications@github.com wrote:
|
I was adding a warning for passing a component class to renderComponent because of this Stack Overflow question: http://stackoverflow.com/questions/21948048/react-cant-get-past-no-method-mountcomponentintonode. |
I think this is fixed. Not sure if we have a solid unit test to cover this. |
Fixes facebook#1164. Test Plan: grunt test
Previously the checks for components were the same as class. This changes in the new version of react. See this issue: facebook/react#1164
The last two assertions in this new test don't pass because of the duck-typing check added in fc2805f.
@sebmarkbage Not quite sure what you had in mind here. Not every object whose
.type
is a component class is a valid descriptor… right?The text was updated successfully, but these errors were encountered: