mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Make sure .createElement({}) warns (#7857)
This is common when forgetting to export anything from a file.
This commit is contained in:
1 parent
23cd77b683
commit
be63afcb64
1 file changed
+4
-2
@@ -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