Make sure .createElement({}) warns (#7857)
This is common when forgetting to export anything from a file.
Ben Alpert committed
Oct 3, 2016 at 17:24 UTC
be63afcb6448469072a329d427c39a11c1d7df2b
1 file changed
+4
-2
src/isomorphic/classic/element/ReactElementValidator.js
+4
-2
@@ -183,8 +183,10 @@ function validatePropTypes(element) {
183
var ReactElementValidator = {
184
185
createElement: function(type, props, children) {
186
- var validType = typeof type === 'string' || typeof type === 'function' ||
187
- (type !== null && typeof type === 'object');
186
+ var validType =
187
+ typeof type === 'string' ||
188
+ typeof type === 'function' ||
189
+ type !== null && typeof type === 'object' && typeof type.tag === 'number';
190
// We warn in this case but don't throw. We expect the element creation to
191
// succeed and there will likely be errors in render.
192
if (!validType) {