react 16.4.0 → 16.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /** @license React v16.4.0
1
+ /** @license React v16.4.1
2
2
  * react.development.js
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -24,7 +24,7 @@ var checkPropTypes = require('prop-types/checkPropTypes');
24
24
 
25
25
  // TODO: this is special because it gets imported during build.
26
26
 
27
- var ReactVersion = '16.4.0';
27
+ var ReactVersion = '16.4.1';
28
28
 
29
29
  // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
30
30
  // nor polyfill, then a plain number is used for performance.
@@ -88,9 +88,6 @@ var enableSuspense = false;
88
88
  // Gather advanced timing metrics for Profiler subtrees.
89
89
 
90
90
 
91
- // Fires getDerivedStateFromProps for state *or* props changes
92
-
93
-
94
91
  // Only used in www builds.
95
92
 
96
93
  /**
@@ -887,7 +884,7 @@ function forEachSingleChild(bookKeeping, child, name) {
887
884
  /**
888
885
  * Iterates through children that are typically specified as `props.children`.
889
886
  *
890
- * See https://reactjs.org/docs/react-api.html#react.children.foreach
887
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
891
888
  *
892
889
  * The provided forEachFunc(child, index) will be called for each
893
890
  * leaf child.
@@ -939,7 +936,7 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
939
936
  /**
940
937
  * Maps children that are typically specified as `props.children`.
941
938
  *
942
- * See https://reactjs.org/docs/react-api.html#react.children.map
939
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
943
940
  *
944
941
  * The provided mapFunction(child, key, index) will be called for each
945
942
  * leaf child.
@@ -962,7 +959,7 @@ function mapChildren(children, func, context) {
962
959
  * Count the number of children that are typically specified as
963
960
  * `props.children`.
964
961
  *
965
- * See https://reactjs.org/docs/react-api.html#react.children.count
962
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
966
963
  *
967
964
  * @param {?*} children Children tree container.
968
965
  * @return {number} The number of children.
@@ -975,7 +972,7 @@ function countChildren(children) {
975
972
  * Flatten a children object (typically specified as `props.children`) and
976
973
  * return an array with appropriately re-keyed children.
977
974
  *
978
- * See https://reactjs.org/docs/react-api.html#react.children.toarray
975
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
979
976
  */
980
977
  function toArray(children) {
981
978
  var result = [];
@@ -987,7 +984,7 @@ function toArray(children) {
987
984
  * Returns the first child in a collection of children and verifies that there
988
985
  * is only one child in the collection.
989
986
  *
990
- * See https://reactjs.org/docs/react-api.html#react.children.only
987
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
991
988
  *
992
989
  * The current implementation of this function assumes that a single child gets
993
990
  * passed without a wrapper, but the purpose of this helper function is to
@@ -1130,10 +1127,16 @@ var getStackAddendum = function () {};
1130
1127
  return '#text';
1131
1128
  } else if (typeof element.type === 'string') {
1132
1129
  return element.type;
1133
- } else if (element.type === REACT_FRAGMENT_TYPE) {
1130
+ }
1131
+
1132
+ var type = element.type;
1133
+ if (type === REACT_FRAGMENT_TYPE) {
1134
1134
  return 'React.Fragment';
1135
+ } else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
1136
+ var functionName = type.render.displayName || type.render.name || '';
1137
+ return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
1135
1138
  } else {
1136
- return element.type.displayName || element.type.name || 'Unknown';
1139
+ return type.displayName || type.name || 'Unknown';
1137
1140
  }
1138
1141
  };
1139
1142
 
@@ -1277,22 +1280,31 @@ function validateChildKeys(node, parentType) {
1277
1280
  * @param {ReactElement} element
1278
1281
  */
1279
1282
  function validatePropTypes(element) {
1280
- var componentClass = element.type;
1281
- if (typeof componentClass !== 'function') {
1283
+ var type = element.type;
1284
+ var name = void 0,
1285
+ propTypes = void 0;
1286
+ if (typeof type === 'function') {
1287
+ // Class or functional component
1288
+ name = type.displayName || type.name;
1289
+ propTypes = type.propTypes;
1290
+ } else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
1291
+ // ForwardRef
1292
+ var functionName = type.render.displayName || type.render.name || '';
1293
+ name = functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
1294
+ propTypes = type.propTypes;
1295
+ } else {
1282
1296
  return;
1283
1297
  }
1284
- var name = componentClass.displayName || componentClass.name;
1285
- var propTypes = componentClass.propTypes;
1286
1298
  if (propTypes) {
1287
1299
  currentlyValidatingElement = element;
1288
1300
  checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum);
1289
1301
  currentlyValidatingElement = null;
1290
- } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1302
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1291
1303
  propTypesMisspellWarningShown = true;
1292
1304
  warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
1293
1305
  }
1294
- if (typeof componentClass.getDefaultProps === 'function') {
1295
- !componentClass.getDefaultProps.isReactClassApproved ? warning(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
1306
+ if (typeof type.getDefaultProps === 'function') {
1307
+ !type.getDefaultProps.isReactClassApproved ? warning(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
1296
1308
  }
1297
1309
  }
1298
1310
 
@@ -1,4 +1,4 @@
1
- /** @license React v16.4.0
1
+ /** @license React v16.4.1
2
2
  * react.production.min.js
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -18,5 +18,5 @@ h=0;!(d=a.next()).done;)d=d.value,f=b+T(d,h++),g+=S(d,f,e,c);else"object"===d&&(
18
18
  function V(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?W(a,c,e,q.thatReturnsArgument):null!=a&&(N(a)&&(b=d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+e,a={$$typeof:t,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),c.push(a))}function W(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(O,"$&/")+"/");b=Q(b,g,c,d);null==a||S(a,"",V,b);R(b)}
19
19
  var X={Children:{map:function(a,b,e){if(null==a)return a;var c=[];W(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=Q(null,null,b,e);null==a||S(a,"",U,b);R(b)},count:function(a){return null==a?0:S(a,"",q.thatReturnsNull,null)},toArray:function(a){var b=[];W(a,b,null,q.thatReturnsArgument);return b},only:function(a){N(a)?void 0:D("143");return a}},createRef:function(){return{current:null}},Component:F,PureComponent:H,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:z,
20
20
  _calculateChangedBits:b,_defaultValue:a,_currentValue:a,_currentValue2:a,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null};a.Provider={$$typeof:y,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:B,render:a}},Fragment:v,StrictMode:w,unstable_AsyncMode:A,unstable_Profiler:x,createElement:M,cloneElement:function(a,b,e){null===a||void 0===a?D("267",a):void 0;var c=void 0,d=k({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,f=J.current);void 0!==
21
- b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)K.call(b,c)&&!L.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:t,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.4.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:J,
21
+ b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)K.call(b,c)&&!L.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:t,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.4.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:J,
22
22
  assign:k}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default?Z.default:Z;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "react"
6
6
  ],
7
- "version": "16.4.0",
7
+ "version": "16.4.1",
8
8
  "homepage": "https://reactjs.org/",
9
9
  "bugs": "https://github.com/facebook/react/issues",
10
10
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- /** @license React v16.4.0
1
+ /** @license React v16.4.1
2
2
  * react.development.js
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -108,7 +108,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
108
108
 
109
109
  // TODO: this is special because it gets imported during build.
110
110
 
111
- var ReactVersion = '16.4.0';
111
+ var ReactVersion = '16.4.1';
112
112
 
113
113
  // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
114
114
  // nor polyfill, then a plain number is used for performance.
@@ -226,9 +226,6 @@ var enableSuspense = false;
226
226
  // Gather advanced timing metrics for Profiler subtrees.
227
227
 
228
228
 
229
- // Fires getDerivedStateFromProps for state *or* props changes
230
-
231
-
232
229
  // Only used in www builds.
233
230
 
234
231
  /**
@@ -1141,7 +1138,7 @@ function forEachSingleChild(bookKeeping, child, name) {
1141
1138
  /**
1142
1139
  * Iterates through children that are typically specified as `props.children`.
1143
1140
  *
1144
- * See https://reactjs.org/docs/react-api.html#react.children.foreach
1141
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1145
1142
  *
1146
1143
  * The provided forEachFunc(child, index) will be called for each
1147
1144
  * leaf child.
@@ -1193,7 +1190,7 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1193
1190
  /**
1194
1191
  * Maps children that are typically specified as `props.children`.
1195
1192
  *
1196
- * See https://reactjs.org/docs/react-api.html#react.children.map
1193
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1197
1194
  *
1198
1195
  * The provided mapFunction(child, key, index) will be called for each
1199
1196
  * leaf child.
@@ -1216,7 +1213,7 @@ function mapChildren(children, func, context) {
1216
1213
  * Count the number of children that are typically specified as
1217
1214
  * `props.children`.
1218
1215
  *
1219
- * See https://reactjs.org/docs/react-api.html#react.children.count
1216
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1220
1217
  *
1221
1218
  * @param {?*} children Children tree container.
1222
1219
  * @return {number} The number of children.
@@ -1229,7 +1226,7 @@ function countChildren(children) {
1229
1226
  * Flatten a children object (typically specified as `props.children`) and
1230
1227
  * return an array with appropriately re-keyed children.
1231
1228
  *
1232
- * See https://reactjs.org/docs/react-api.html#react.children.toarray
1229
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1233
1230
  */
1234
1231
  function toArray(children) {
1235
1232
  var result = [];
@@ -1241,7 +1238,7 @@ function toArray(children) {
1241
1238
  * Returns the first child in a collection of children and verifies that there
1242
1239
  * is only one child in the collection.
1243
1240
  *
1244
- * See https://reactjs.org/docs/react-api.html#react.children.only
1241
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1245
1242
  *
1246
1243
  * The current implementation of this function assumes that a single child gets
1247
1244
  * passed without a wrapper, but the purpose of this helper function is to
@@ -1457,10 +1454,16 @@ var getStackAddendum = function () {};
1457
1454
  return '#text';
1458
1455
  } else if (typeof element.type === 'string') {
1459
1456
  return element.type;
1460
- } else if (element.type === REACT_FRAGMENT_TYPE) {
1457
+ }
1458
+
1459
+ var type = element.type;
1460
+ if (type === REACT_FRAGMENT_TYPE) {
1461
1461
  return 'React.Fragment';
1462
+ } else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
1463
+ var functionName = type.render.displayName || type.render.name || '';
1464
+ return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
1462
1465
  } else {
1463
- return element.type.displayName || element.type.name || 'Unknown';
1466
+ return type.displayName || type.name || 'Unknown';
1464
1467
  }
1465
1468
  };
1466
1469
 
@@ -1604,22 +1607,31 @@ function validateChildKeys(node, parentType) {
1604
1607
  * @param {ReactElement} element
1605
1608
  */
1606
1609
  function validatePropTypes(element) {
1607
- var componentClass = element.type;
1608
- if (typeof componentClass !== 'function') {
1610
+ var type = element.type;
1611
+ var name = void 0,
1612
+ propTypes = void 0;
1613
+ if (typeof type === 'function') {
1614
+ // Class or functional component
1615
+ name = type.displayName || type.name;
1616
+ propTypes = type.propTypes;
1617
+ } else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
1618
+ // ForwardRef
1619
+ var functionName = type.render.displayName || type.render.name || '';
1620
+ name = functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
1621
+ propTypes = type.propTypes;
1622
+ } else {
1609
1623
  return;
1610
1624
  }
1611
- var name = componentClass.displayName || componentClass.name;
1612
- var propTypes = componentClass.propTypes;
1613
1625
  if (propTypes) {
1614
1626
  currentlyValidatingElement = element;
1615
1627
  checkPropTypes_1(propTypes, element.props, 'prop', name, getStackAddendum);
1616
1628
  currentlyValidatingElement = null;
1617
- } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1629
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1618
1630
  propTypesMisspellWarningShown = true;
1619
1631
  warning_1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
1620
1632
  }
1621
- if (typeof componentClass.getDefaultProps === 'function') {
1622
- !componentClass.getDefaultProps.isReactClassApproved ? warning_1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
1633
+ if (typeof type.getDefaultProps === 'function') {
1634
+ !type.getDefaultProps.isReactClassApproved ? warning_1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
1623
1635
  }
1624
1636
  }
1625
1637
 
@@ -1,4 +1,4 @@
1
- /** @license React v16.4.0
1
+ /** @license React v16.4.1
2
2
  * react.production.min.js
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -19,4 +19,4 @@ c.thatReturnsTrue=h(!0);c.thatReturnsNull=h(null);c.thatReturnsThis=function(){r
19
19
  function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};F.prototype=q.prototype;c=v.prototype=new F;c.constructor=v;B(c,q.prototype);c.isPureReactComponent=!0;var w={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0},M=/\/+/g,u=[];n={Children:{map:function(a,b,c){if(null==a)return a;var d=[];z(a,d,null,b,c);return d},forEach:function(a,b,c){if(null==a)return a;b=J(null,null,b,c);null==a||t(a,"",R,b);K(b)},count:function(a){return null==a?0:t(a,"",A.thatReturnsNull,
20
20
  null)},toArray:function(a){var b=[];z(a,b,null,A.thatReturnsArgument);return b},only:function(a){x(a)?void 0:p("143");return a}},createRef:function(){return{current:null}},Component:q,PureComponent:v,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:X,_calculateChangedBits:b,_defaultValue:a,_currentValue:a,_currentValue2:a,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null};a.Provider={$$typeof:W,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:Z,render:a}},
21
21
  Fragment:n,StrictMode:C,unstable_AsyncMode:Y,unstable_Profiler:V,createElement:G,cloneElement:function(a,b,c){null===a||void 0===a?p("267",a):void 0;var d=void 0,e=B({},a.props),f=a.key,h=a.ref,g=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,g=w.current);void 0!==b.key&&(f=""+b.key);var m=void 0;a.type&&a.type.defaultProps&&(m=a.type.defaultProps);for(d in b)H.call(b,d)&&!I.hasOwnProperty(d)&&(e[d]=void 0===b[d]&&void 0!==m?m[d]:b[d])}d=arguments.length-2;if(1===d)e.children=c;else if(1<d){m=Array(d);
22
- for(var l=0;l<d;l++)m[l]=arguments[l+2];e.children=m}return{$$typeof:r,type:a.type,key:f,ref:h,props:e,_owner:g}},createFactory:function(a){var b=G.bind(null,a);b.type=a;return b},isValidElement:x,version:"16.4.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:w,assign:B}};n=(C={default:n},n)||C;return n.default?n.default:n});
22
+ for(var l=0;l<d;l++)m[l]=arguments[l+2];e.children=m}return{$$typeof:r,type:a.type,key:f,ref:h,props:e,_owner:g}},createFactory:function(a){var b=G.bind(null,a);b.type=a;return b},isValidElement:x,version:"16.4.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:w,assign:B}};n=(C={default:n},n)||C;return n.default?n.default:n});