mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Make sure .createElement({}) warns (#7857)
This is common when forgetting to export anything from a file.
This commit is contained in:
@@ -183,8 +183,10 @@ function validatePropTypes(element) {
|
||||
var ReactElementValidator = {
|
||||
|
||||
createElement: function(type, props, children) {
|
||||
var validType = typeof type === 'string' || typeof type === 'function' ||
|
||||
(type !== null && typeof type === 'object');
|
||||
var validType =
|
||||
typeof type === 'string' ||
|
||||
typeof type === 'function' ||
|
||||
type !== null && typeof type === 'object' && typeof type.tag === 'number';
|
||||
// We warn in this case but don't throw. We expect the element creation to
|
||||
// succeed and there will likely be errors in render.
|
||||
if (!validType) {
|
||||
|
||||
Reference in New Issue
Block a user