Skip to content
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

Improve error message when mounting non-string/function elements #4154

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

sophiebits
Copy link
Collaborator

People keep getting tripped up by the nonsense error you currently get and manage not to see the warning. See #3478. I think this check is cheap enough. (We also have a warning at element creation time, which is more useful if you notice it.)

'Invariant Violation: Element type is invalid: expected a string (for ' +
'built-in components) or a class/function (for composite components) ' +
'but got: object.'
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to add one of these testamajiggers for the addendum?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a secret test already in src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you do

sophiebits added a commit that referenced this pull request Jun 17, 2015
Improve error message when mounting non-string/function elements
@sophiebits sophiebits merged commit 0160212 into facebook:master Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants