react 0.0.0-experimental-269dd6ec5 → 0.0.0-experimental-bd070eb2c

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.
@@ -148,8 +148,14 @@ function isValidElementType(type) {
148
148
  }
149
149
 
150
150
  function getWrappedName(outerType, innerType, wrapperName) {
151
+ var displayName = outerType.displayName;
152
+
153
+ if (displayName) {
154
+ return displayName;
155
+ }
156
+
151
157
  var functionName = innerType.displayName || innerType.name || '';
152
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
158
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
153
159
  } // Keep in sync with react-reconciler/getComponentNameFromFiber
154
160
 
155
161
 
@@ -215,7 +221,13 @@ function getComponentNameFromType(type) {
215
221
  return getWrappedName(type, type.render, 'ForwardRef');
216
222
 
217
223
  case REACT_MEMO_TYPE:
218
- return getComponentNameFromType(type.type);
224
+ var outerName = type.displayName || null;
225
+
226
+ if (outerName !== null) {
227
+ return outerName;
228
+ }
229
+
230
+ return getComponentNameFromType(type.type) || 'Memo';
219
231
 
220
232
  case REACT_LAZY_TYPE:
221
233
  {
@@ -148,8 +148,14 @@ function isValidElementType(type) {
148
148
  }
149
149
 
150
150
  function getWrappedName(outerType, innerType, wrapperName) {
151
+ var displayName = outerType.displayName;
152
+
153
+ if (displayName) {
154
+ return displayName;
155
+ }
156
+
151
157
  var functionName = innerType.displayName || innerType.name || '';
152
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
158
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
153
159
  } // Keep in sync with react-reconciler/getComponentNameFromFiber
154
160
 
155
161
 
@@ -215,7 +221,13 @@ function getComponentNameFromType(type) {
215
221
  return getWrappedName(type, type.render, 'ForwardRef');
216
222
 
217
223
  case REACT_MEMO_TYPE:
218
- return getComponentNameFromType(type.type);
224
+ var outerName = type.displayName || null;
225
+
226
+ if (outerName !== null) {
227
+ return outerName;
228
+ }
229
+
230
+ return getComponentNameFromType(type.type) || 'Memo';
219
231
 
220
232
  case REACT_LAZY_TYPE:
221
233
  {
@@ -15,7 +15,7 @@ if (process.env.NODE_ENV !== "production") {
15
15
 
16
16
  var _assign = require('object-assign');
17
17
 
18
- var ReactVersion = '17.0.3-experimental-269dd6ec5';
18
+ var ReactVersion = '17.0.3-experimental-bd070eb2c';
19
19
 
20
20
  // ATTENTION
21
21
  // When adding new symbols to this file,
@@ -450,8 +450,14 @@ function isArray(a) {
450
450
  }
451
451
 
452
452
  function getWrappedName(outerType, innerType, wrapperName) {
453
+ var displayName = outerType.displayName;
454
+
455
+ if (displayName) {
456
+ return displayName;
457
+ }
458
+
453
459
  var functionName = innerType.displayName || innerType.name || '';
454
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
460
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
455
461
  } // Keep in sync with react-reconciler/getComponentNameFromFiber
456
462
 
457
463
 
@@ -517,7 +523,13 @@ function getComponentNameFromType(type) {
517
523
  return getWrappedName(type, type.render, 'ForwardRef');
518
524
 
519
525
  case REACT_MEMO_TYPE:
520
- return getComponentNameFromType(type.type);
526
+ var outerName = type.displayName || null;
527
+
528
+ if (outerName !== null) {
529
+ return outerName;
530
+ }
531
+
532
+ return getComponentNameFromType(type.type) || 'Memo';
521
533
 
522
534
  case REACT_LAZY_TYPE:
523
535
  {
@@ -1282,9 +1294,15 @@ function forwardRef(render) {
1282
1294
  return ownName;
1283
1295
  },
1284
1296
  set: function (name) {
1285
- ownName = name;
1286
-
1287
- if (render.displayName == null) {
1297
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1298
+ // because the component may be used elsewhere.
1299
+ // But it's nice for anonymous functions to inherit the name,
1300
+ // so that our component-stack generation logic will display their frames.
1301
+ // An anonymous function generally suggests a pattern like:
1302
+ // React.forwardRef((props, ref) => {...});
1303
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1304
+
1305
+ if (!render.name && !render.displayName) {
1288
1306
  render.displayName = name;
1289
1307
  }
1290
1308
  }
@@ -1349,9 +1367,15 @@ function memo(type, compare) {
1349
1367
  return ownName;
1350
1368
  },
1351
1369
  set: function (name) {
1352
- ownName = name;
1353
-
1354
- if (type.displayName == null) {
1370
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1371
+ // because the component may be used elsewhere.
1372
+ // But it's nice for anonymous functions to inherit the name,
1373
+ // so that our component-stack generation logic will display their frames.
1374
+ // An anonymous function generally suggests a pattern like:
1375
+ // React.memo((props) => {...});
1376
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1377
+
1378
+ if (!type.name && !type.displayName) {
1355
1379
  type.displayName = name;
1356
1380
  }
1357
1381
  }
@@ -20,4 +20,4 @@ exports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(x(267,a
20
20
  key:c,ref:k,props:d,_owner:h}};exports.createElement=function(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)F.call(b,d)&&!H.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:n,type:a,key:k,ref:h,props:c,_owner:G.current}};exports.createRef=function(){return{current:null}};
21
21
  exports.forwardRef=function(a){return{$$typeof:q,render:a}};exports.isValidElement=J;exports.lazy=function(a){return{$$typeof:t,_payload:{_status:-1,_result:a},_init:O}};exports.memo=function(a,b){return{$$typeof:r,type:a,compare:void 0===b?null:b}};exports.unstable_createMutableSource=function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};exports.unstable_getCacheForType=function(a){return P.current.getCacheForType(a)};
22
22
  exports.unstable_useDeferredValue=function(a){return P.current.useDeferredValue(a)};exports.unstable_useMutableSource=function(a,b,e){return P.current.useMutableSource(a,b,e)};exports.unstable_useOpaqueIdentifier=function(){return P.current.useOpaqueIdentifier()};exports.useCallback=function(a,b){return P.current.useCallback(a,b)};exports.useContext=function(a){return P.current.useContext(a)};exports.useDebugValue=function(){};exports.useMemo=function(a,b){return P.current.useMemo(a,b)};
23
- exports.version="17.0.3-experimental-269dd6ec5";
23
+ exports.version="17.0.3-experimental-bd070eb2c";
@@ -15,7 +15,7 @@ if (process.env.NODE_ENV !== "production") {
15
15
 
16
16
  var _assign = require('object-assign');
17
17
 
18
- var ReactVersion = '17.0.3-experimental-269dd6ec5';
18
+ var ReactVersion = '17.0.3-experimental-bd070eb2c';
19
19
 
20
20
  // ATTENTION
21
21
  // When adding new symbols to this file,
@@ -450,8 +450,14 @@ function isArray(a) {
450
450
  }
451
451
 
452
452
  function getWrappedName(outerType, innerType, wrapperName) {
453
+ var displayName = outerType.displayName;
454
+
455
+ if (displayName) {
456
+ return displayName;
457
+ }
458
+
453
459
  var functionName = innerType.displayName || innerType.name || '';
454
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
460
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
455
461
  } // Keep in sync with react-reconciler/getComponentNameFromFiber
456
462
 
457
463
 
@@ -517,7 +523,13 @@ function getComponentNameFromType(type) {
517
523
  return getWrappedName(type, type.render, 'ForwardRef');
518
524
 
519
525
  case REACT_MEMO_TYPE:
520
- return getComponentNameFromType(type.type);
526
+ var outerName = type.displayName || null;
527
+
528
+ if (outerName !== null) {
529
+ return outerName;
530
+ }
531
+
532
+ return getComponentNameFromType(type.type) || 'Memo';
521
533
 
522
534
  case REACT_LAZY_TYPE:
523
535
  {
@@ -1393,9 +1405,15 @@ function forwardRef(render) {
1393
1405
  return ownName;
1394
1406
  },
1395
1407
  set: function (name) {
1396
- ownName = name;
1397
-
1398
- if (render.displayName == null) {
1408
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1409
+ // because the component may be used elsewhere.
1410
+ // But it's nice for anonymous functions to inherit the name,
1411
+ // so that our component-stack generation logic will display their frames.
1412
+ // An anonymous function generally suggests a pattern like:
1413
+ // React.forwardRef((props, ref) => {...});
1414
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1415
+
1416
+ if (!render.name && !render.displayName) {
1399
1417
  render.displayName = name;
1400
1418
  }
1401
1419
  }
@@ -1460,9 +1478,15 @@ function memo(type, compare) {
1460
1478
  return ownName;
1461
1479
  },
1462
1480
  set: function (name) {
1463
- ownName = name;
1464
-
1465
- if (type.displayName == null) {
1481
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1482
+ // because the component may be used elsewhere.
1483
+ // But it's nice for anonymous functions to inherit the name,
1484
+ // so that our component-stack generation logic will display their frames.
1485
+ // An anonymous function generally suggests a pattern like:
1486
+ // React.memo((props) => {...});
1487
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1488
+
1489
+ if (!type.name && !type.displayName) {
1466
1490
  type.displayName = name;
1467
1491
  }
1468
1492
  }
@@ -23,4 +23,4 @@ key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a){a={$$typeof:r,_
23
23
  exports.lazy=function(a){return{$$typeof:v,_payload:{_status:-1,_result:a},_init:R}};exports.memo=function(a,b){return{$$typeof:u,type:a,compare:void 0===b?null:b}};exports.unstable_createMutableSource=function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};exports.unstable_getCacheForType=function(a){return S.current.getCacheForType(a)};
24
24
  exports.unstable_startTransition=function(a){var b=T.transition;T.transition=1;try{a()}finally{T.transition=b}};exports.unstable_useCacheRefresh=function(){return S.current.useCacheRefresh()};exports.unstable_useDeferredValue=function(a){return S.current.useDeferredValue(a)};exports.unstable_useMutableSource=function(a,b,c){return S.current.useMutableSource(a,b,c)};exports.unstable_useOpaqueIdentifier=function(){return S.current.useOpaqueIdentifier()};exports.unstable_useTransition=function(){return S.current.useTransition()};
25
25
  exports.useCallback=function(a,b){return S.current.useCallback(a,b)};exports.useContext=function(a){return S.current.useContext(a)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return S.current.useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return S.current.useImperativeHandle(a,b,c)};exports.useLayoutEffect=function(a,b){return S.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S.current.useMemo(a,b)};
26
- exports.useReducer=function(a,b,c){return S.current.useReducer(a,b,c)};exports.useRef=function(a){return S.current.useRef(a)};exports.useState=function(a){return S.current.useState(a)};exports.version="17.0.3-experimental-269dd6ec5";
26
+ exports.useReducer=function(a,b,c){return S.current.useReducer(a,b,c)};exports.useRef=function(a){return S.current.useRef(a)};exports.useState=function(a){return S.current.useState(a)};exports.version="17.0.3-experimental-bd070eb2c";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "react"
6
6
  ],
7
- "version": "0.0.0-experimental-269dd6ec5",
7
+ "version": "0.0.0-experimental-bd070eb2c",
8
8
  "homepage": "https://reactjs.org/",
9
9
  "bugs": "https://github.com/facebook/react/issues",
10
10
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  (global = global || self, factory(global.React = {}));
13
13
  }(this, (function (exports) { 'use strict';
14
14
 
15
- var ReactVersion = '17.0.3-experimental-269dd6ec5';
15
+ var ReactVersion = '17.0.3-experimental-bd070eb2c';
16
16
 
17
17
  // ATTENTION
18
18
  // When adding new symbols to this file,
@@ -475,8 +475,14 @@
475
475
  }
476
476
 
477
477
  function getWrappedName(outerType, innerType, wrapperName) {
478
+ var displayName = outerType.displayName;
479
+
480
+ if (displayName) {
481
+ return displayName;
482
+ }
483
+
478
484
  var functionName = innerType.displayName || innerType.name || '';
479
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
485
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
480
486
  } // Keep in sync with react-reconciler/getComponentNameFromFiber
481
487
 
482
488
 
@@ -542,7 +548,13 @@
542
548
  return getWrappedName(type, type.render, 'ForwardRef');
543
549
 
544
550
  case REACT_MEMO_TYPE:
545
- return getComponentNameFromType(type.type);
551
+ var outerName = type.displayName || null;
552
+
553
+ if (outerName !== null) {
554
+ return outerName;
555
+ }
556
+
557
+ return getComponentNameFromType(type.type) || 'Memo';
546
558
 
547
559
  case REACT_LAZY_TYPE:
548
560
  {
@@ -1418,9 +1430,15 @@
1418
1430
  return ownName;
1419
1431
  },
1420
1432
  set: function (name) {
1421
- ownName = name;
1422
-
1423
- if (render.displayName == null) {
1433
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1434
+ // because the component may be used elsewhere.
1435
+ // But it's nice for anonymous functions to inherit the name,
1436
+ // so that our component-stack generation logic will display their frames.
1437
+ // An anonymous function generally suggests a pattern like:
1438
+ // React.forwardRef((props, ref) => {...});
1439
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1440
+
1441
+ if (!render.name && !render.displayName) {
1424
1442
  render.displayName = name;
1425
1443
  }
1426
1444
  }
@@ -1485,9 +1503,15 @@
1485
1503
  return ownName;
1486
1504
  },
1487
1505
  set: function (name) {
1488
- ownName = name;
1489
-
1490
- if (type.displayName == null) {
1506
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1507
+ // because the component may be used elsewhere.
1508
+ // But it's nice for anonymous functions to inherit the name,
1509
+ // so that our component-stack generation logic will display their frames.
1510
+ // An anonymous function generally suggests a pattern like:
1511
+ // React.memo((props) => {...});
1512
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1513
+
1514
+ if (!type.name && !type.displayName) {
1491
1515
  type.displayName = name;
1492
1516
  }
1493
1517
  }
@@ -28,5 +28,5 @@ a.type.defaultProps;for(h in b)ba.call(b,h)&&!ca.hasOwnProperty(h)&&(d[h]=void 0
28
28
  function(a){var b=Z.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:ma,render:a}};c.isValidElement=L;c.lazy=function(a){return{$$typeof:oa,_payload:{_status:-1,_result:a},_init:va}};c.memo=function(a,b){return{$$typeof:na,type:a,compare:void 0===b?null:b}};c.unstable_createMutableSource=function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};c.unstable_getCacheForType=
29
29
  function(a){return g.current.getCacheForType(a)};c.unstable_startTransition=function(a){var b=I.transition;I.transition=1;try{a()}finally{I.transition=b}};c.unstable_useCacheRefresh=function(){return g.current.useCacheRefresh()};c.unstable_useDeferredValue=function(a){return g.current.useDeferredValue(a)};c.unstable_useMutableSource=function(a,b,c){return g.current.useMutableSource(a,b,c)};c.unstable_useOpaqueIdentifier=function(){return g.current.useOpaqueIdentifier()};c.unstable_useTransition=function(){return g.current.useTransition()};
30
30
  c.useCallback=function(a,b){return g.current.useCallback(a,b)};c.useContext=function(a){return g.current.useContext(a)};c.useDebugValue=function(a,b){};c.useEffect=function(a,b){return g.current.useEffect(a,b)};c.useImperativeHandle=function(a,b,c){return g.current.useImperativeHandle(a,b,c)};c.useLayoutEffect=function(a,b){return g.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return g.current.useMemo(a,b)};c.useReducer=function(a,b,c){return g.current.useReducer(a,b,c)};c.useRef=function(a){return g.current.useRef(a)};
31
- c.useState=function(a){return g.current.useState(a)};c.version="17.0.3-experimental-269dd6ec5"});
31
+ c.useState=function(a){return g.current.useState(a)};c.version="17.0.3-experimental-bd070eb2c"});
32
32
  })();
@@ -28,5 +28,5 @@ a.type.defaultProps;for(h in b)ba.call(b,h)&&!ca.hasOwnProperty(h)&&(d[h]=void 0
28
28
  function(a){var b=Z.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:ma,render:a}};c.isValidElement=L;c.lazy=function(a){return{$$typeof:oa,_payload:{_status:-1,_result:a},_init:va}};c.memo=function(a,b){return{$$typeof:na,type:a,compare:void 0===b?null:b}};c.unstable_createMutableSource=function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};c.unstable_getCacheForType=
29
29
  function(a){return g.current.getCacheForType(a)};c.unstable_startTransition=function(a){var b=I.transition;I.transition=1;try{a()}finally{I.transition=b}};c.unstable_useCacheRefresh=function(){return g.current.useCacheRefresh()};c.unstable_useDeferredValue=function(a){return g.current.useDeferredValue(a)};c.unstable_useMutableSource=function(a,b,c){return g.current.useMutableSource(a,b,c)};c.unstable_useOpaqueIdentifier=function(){return g.current.useOpaqueIdentifier()};c.unstable_useTransition=function(){return g.current.useTransition()};
30
30
  c.useCallback=function(a,b){return g.current.useCallback(a,b)};c.useContext=function(a){return g.current.useContext(a)};c.useDebugValue=function(a,b){};c.useEffect=function(a,b){return g.current.useEffect(a,b)};c.useImperativeHandle=function(a,b,c){return g.current.useImperativeHandle(a,b,c)};c.useLayoutEffect=function(a,b){return g.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return g.current.useMemo(a,b)};c.useReducer=function(a,b,c){return g.current.useReducer(a,b,c)};c.useRef=function(a){return g.current.useRef(a)};
31
- c.useState=function(a){return g.current.useState(a)};c.version="17.0.3-experimental-269dd6ec5"});
31
+ c.useState=function(a){return g.current.useState(a)};c.version="17.0.3-experimental-bd070eb2c"});
32
32
  })();