Skip to content

Commit 697c09a

Browse files
committed
Merge pull request facebook#4759 from spicyj/devprod
Fix diverging behavior of ReactFragment in `__DEV__`
2 parents 4b9c349 + 7e5ce19 commit 697c09a

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

src/addons/ReactFragment.js

+16-17
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,23 @@ var ReactFragment = {
3434
// Wrap a keyed object in an opaque proxy that warns you if you access any
3535
// of its properties.
3636
create: function(object) {
37-
if (__DEV__) {
38-
if (typeof object !== 'object' || !object || Array.isArray(object)) {
39-
warning(
40-
false,
41-
'React.addons.createFragment only accepts a single object. Got: %s',
42-
object
43-
);
44-
return object;
45-
}
46-
if (ReactElement.isValidElement(object)) {
47-
warning(
48-
false,
49-
'React.addons.createFragment does not accept a ReactElement ' +
50-
'without a wrapper object.'
51-
);
52-
return object;
53-
}
37+
if (typeof object !== 'object' || !object || Array.isArray(object)) {
38+
warning(
39+
false,
40+
'React.addons.createFragment only accepts a single object. Got: %s',
41+
object
42+
);
43+
return object;
5444
}
45+
if (ReactElement.isValidElement(object)) {
46+
warning(
47+
false,
48+
'React.addons.createFragment does not accept a ReactElement ' +
49+
'without a wrapper object.'
50+
);
51+
return object;
52+
}
53+
5554
invariant(
5655
object.nodeType !== 1,
5756
'React.addons.createFragment(...): Encountered an invalid child; DOM ' +

0 commit comments

Comments
 (0)