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

Display error when trying to create an element of type boolean. Fixes #3478 #3521

Merged
merged 2 commits into from
Mar 26, 2015
Merged

Conversation

grant
Copy link
Contributor

@grant grant commented Mar 26, 2015

Disables boolean, number, object element type for React.createElement.

Fixes #3478.

jimfb added a commit that referenced this pull request Mar 26, 2015
Display error when trying to create an element of type `boolean`. Fixes #3478
@jimfb jimfb merged commit b3c75d8 into facebook:master Mar 26, 2015
@sophiebits
Copy link
Collaborator

objects too. Really the message should probably just say that only strings are functions are allowed, not %s. (typeof type)

'React.createElement: type should not be null or undefined. It should ' +
'be a string (for DOM elements) or a ReactClass (for composite ' +
'components).%s',
warning(typeof type === 'string' || typeof type === 'function',
Copy link
Collaborator

Choose a reason for hiding this comment

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

FB style is to have a newline after ( here

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.

Confusing error message when passing non string, non component class to React.createElement
3 participants