react 0.0.0-experimental-ea6ed3dbb → 0.0.0-experimental-d28bd2994
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.
- package/build-info.json +4 -4
- package/cjs/react.development.js +63 -501
- package/cjs/react.production.min.js +18 -18
- package/package.json +1 -1
- package/umd/react.development.js +2650 -3159
- package/umd/react.production.min.js +26 -26
- package/umd/react.profiling.min.js +33 -33
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "91351",
|
|
4
|
+
"checksum": "b0ed8f5",
|
|
5
|
+
"commit": "d28bd2994",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.12.0-experimental-
|
|
7
|
+
"reactVersion": "16.12.0-experimental-d28bd2994"
|
|
8
8
|
}
|
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-d28bd2994
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -18,9 +18,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
18
18
|
var _assign = require('object-assign');
|
|
19
19
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var ReactVersion = '16.12.0-experimental-ea6ed3dbb';
|
|
21
|
+
var ReactVersion = '16.12.0-experimental-d28bd2994';
|
|
24
22
|
|
|
25
23
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
26
24
|
// nor polyfill, then a plain number is used for performance.
|
|
@@ -32,16 +30,13 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
32
30
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
33
31
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
34
32
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
35
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
36
|
-
|
|
37
|
-
|
|
38
33
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
39
34
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
40
35
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
41
36
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
42
37
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
43
38
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
44
|
-
var
|
|
39
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
45
40
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
46
41
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
47
42
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
@@ -95,7 +90,7 @@ var ReactCurrentOwner = {
|
|
|
95
90
|
};
|
|
96
91
|
|
|
97
92
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
98
|
-
|
|
93
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
99
94
|
var sourceInfo = '';
|
|
100
95
|
|
|
101
96
|
if (source) {
|
|
@@ -125,10 +120,9 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
125
120
|
}
|
|
126
121
|
|
|
127
122
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
128
|
-
}
|
|
123
|
+
}
|
|
129
124
|
|
|
130
125
|
var Resolved = 1;
|
|
131
|
-
|
|
132
126
|
function refineResolvedLazyComponent(lazyComponent) {
|
|
133
127
|
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
134
128
|
}
|
|
@@ -192,7 +186,7 @@ function getComponentName(type) {
|
|
|
192
186
|
case REACT_MEMO_TYPE:
|
|
193
187
|
return getComponentName(type.type);
|
|
194
188
|
|
|
195
|
-
case
|
|
189
|
+
case REACT_BLOCK_TYPE:
|
|
196
190
|
return getComponentName(type.render);
|
|
197
191
|
|
|
198
192
|
case REACT_LAZY_TYPE:
|
|
@@ -333,21 +327,6 @@ function printWarning(level, format, args) {
|
|
|
333
327
|
}
|
|
334
328
|
}
|
|
335
329
|
|
|
336
|
-
// Do not require this module directly! Use normal `invariant` calls with
|
|
337
|
-
// template literal strings. The messages will be replaced with error codes
|
|
338
|
-
// during build.
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Use invariant() to assert state which your program assumes to be true.
|
|
342
|
-
*
|
|
343
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
344
|
-
* to provide information about what broke and what you were
|
|
345
|
-
* expecting.
|
|
346
|
-
*
|
|
347
|
-
* The invariant message will be stripped in production, but the invariant
|
|
348
|
-
* will remain to ensure logic does not differ in production.
|
|
349
|
-
*/
|
|
350
|
-
|
|
351
330
|
var didWarnStateUpdateForUnmountedComponent = {};
|
|
352
331
|
|
|
353
332
|
function warnNoop(publicInstance, callerName) {
|
|
@@ -485,7 +464,7 @@ Component.prototype.isReactComponent = {};
|
|
|
485
464
|
Component.prototype.setState = function (partialState, callback) {
|
|
486
465
|
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
487
466
|
{
|
|
488
|
-
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
467
|
+
throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
|
|
489
468
|
}
|
|
490
469
|
}
|
|
491
470
|
|
|
@@ -575,100 +554,6 @@ function createRef() {
|
|
|
575
554
|
return refObject;
|
|
576
555
|
}
|
|
577
556
|
|
|
578
|
-
// Helps identify side effects in render-phase lifecycle hooks and setState
|
|
579
|
-
// reducers by double invoking them in Strict Mode.
|
|
580
|
-
|
|
581
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
582
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
583
|
-
|
|
584
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
585
|
-
|
|
586
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
587
|
-
|
|
588
|
-
// Trace which interactions trigger each commit.
|
|
589
|
-
|
|
590
|
-
// SSR experiments
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
// Flight experiments
|
|
594
|
-
|
|
595
|
-
var enableChunksAPI = true; // Only used in www builds.
|
|
596
|
-
|
|
597
|
-
// Only used in www builds.
|
|
598
|
-
|
|
599
|
-
// Disable javascript: URL strings in href for XSS protection.
|
|
600
|
-
|
|
601
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
602
|
-
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
603
|
-
|
|
604
|
-
var exposeConcurrentModeAPIs = true;
|
|
605
|
-
// Experimental React Flare event system and event components support.
|
|
606
|
-
|
|
607
|
-
var enableDeprecatedFlareAPI = false; // Experimental Host Component support.
|
|
608
|
-
|
|
609
|
-
var enableFundamentalAPI = false; // Experimental Scope support.
|
|
610
|
-
|
|
611
|
-
var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
612
|
-
|
|
613
|
-
var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
614
|
-
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
|
|
615
|
-
|
|
616
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
617
|
-
// *except* in some of our own tests, where we test incremental loading states.
|
|
618
|
-
|
|
619
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
620
|
-
// in the update queue. This allows reporting and tracing of what is causing
|
|
621
|
-
// the user to see a loading state.
|
|
622
|
-
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
623
|
-
// hydrated or deleted.
|
|
624
|
-
|
|
625
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
626
|
-
// from React.createElement to React.jsx
|
|
627
|
-
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
|
|
633
|
-
|
|
634
|
-
// Controls sequence of passive effect destroy and create functions.
|
|
635
|
-
// If this flag is off, destroy and create functions may be interleaved.
|
|
636
|
-
// When the falg is on, all destroy functions will be run (for all fibers)
|
|
637
|
-
// before any create functions are run, similar to how layout effects work.
|
|
638
|
-
// This flag provides a killswitch if that proves to break existing code somehow.
|
|
639
|
-
|
|
640
|
-
// Controls behavior of deferred effect destroy functions during unmount.
|
|
641
|
-
// Previously these functions were run during commit (along with layout effects).
|
|
642
|
-
// Ideally we should delay these until after commit for performance reasons.
|
|
643
|
-
// This flag provides a killswitch if that proves to break existing code somehow.
|
|
644
|
-
//
|
|
645
|
-
// WARNING This flag only has an affect if used with runAllPassiveEffectDestroysBeforeCreates.
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
// --------------------------
|
|
649
|
-
// Future APIs to be deprecated
|
|
650
|
-
// --------------------------
|
|
651
|
-
// Prevent the value and checked attributes from syncing
|
|
652
|
-
// with their related DOM properties
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
// Disables React.createFactory
|
|
657
|
-
|
|
658
|
-
var disableCreateFactory = false; // Disables hydrate, render, findDOMNode, unmountComponentAtNode
|
|
659
|
-
|
|
660
|
-
// Disables children for <textarea> elements
|
|
661
|
-
|
|
662
|
-
// Disables Maps as ReactElement children
|
|
663
|
-
|
|
664
|
-
var disableMapsAsChildren = false; // Disables ReactDOM.unstable_renderSubtreeIntoContainer
|
|
665
|
-
|
|
666
|
-
// We should remove this flag once the above flag becomes enabled
|
|
667
|
-
|
|
668
|
-
// Disables ReactDOM.unstable_createPortal
|
|
669
|
-
|
|
670
|
-
// Modern event system where events get registered at roots
|
|
671
|
-
|
|
672
557
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
673
558
|
var RESERVED_PROPS = {
|
|
674
559
|
key: true,
|
|
@@ -676,9 +561,7 @@ var RESERVED_PROPS = {
|
|
|
676
561
|
__self: true,
|
|
677
562
|
__source: true
|
|
678
563
|
};
|
|
679
|
-
var specialPropKeyWarningShown;
|
|
680
|
-
var specialPropRefWarningShown;
|
|
681
|
-
var didWarnAboutStringRefs;
|
|
564
|
+
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
682
565
|
|
|
683
566
|
{
|
|
684
567
|
didWarnAboutStringRefs = {};
|
|
@@ -836,79 +719,6 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
836
719
|
|
|
837
720
|
return element;
|
|
838
721
|
};
|
|
839
|
-
/**
|
|
840
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
841
|
-
* @param {*} type
|
|
842
|
-
* @param {object} props
|
|
843
|
-
* @param {string} key
|
|
844
|
-
*/
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
850
|
-
* @param {*} type
|
|
851
|
-
* @param {object} props
|
|
852
|
-
* @param {string} key
|
|
853
|
-
*/
|
|
854
|
-
|
|
855
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
856
|
-
var propName; // Reserved names are extracted
|
|
857
|
-
|
|
858
|
-
var props = {};
|
|
859
|
-
var key = null;
|
|
860
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
861
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
862
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
863
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
864
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
865
|
-
// key is explicitly declared to be undefined or not.
|
|
866
|
-
|
|
867
|
-
if (maybeKey !== undefined) {
|
|
868
|
-
key = '' + maybeKey;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
if (hasValidKey(config)) {
|
|
872
|
-
key = '' + config.key;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
if (hasValidRef(config)) {
|
|
876
|
-
ref = config.ref;
|
|
877
|
-
warnIfStringRefCannotBeAutoConverted(config);
|
|
878
|
-
} // Remaining properties are added to a new props object
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
for (propName in config) {
|
|
882
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
883
|
-
props[propName] = config[propName];
|
|
884
|
-
}
|
|
885
|
-
} // Resolve default props
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
if (type && type.defaultProps) {
|
|
889
|
-
var defaultProps = type.defaultProps;
|
|
890
|
-
|
|
891
|
-
for (propName in defaultProps) {
|
|
892
|
-
if (props[propName] === undefined) {
|
|
893
|
-
props[propName] = defaultProps[propName];
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
if (key || ref) {
|
|
899
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
900
|
-
|
|
901
|
-
if (key) {
|
|
902
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
if (ref) {
|
|
906
|
-
defineRefPropWarningGetter(props, displayName);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
911
|
-
}
|
|
912
722
|
/**
|
|
913
723
|
* Create and return a new ReactElement of the given type.
|
|
914
724
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
@@ -995,12 +805,6 @@ function createElement(type, config, children) {
|
|
|
995
805
|
|
|
996
806
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
997
807
|
}
|
|
998
|
-
/**
|
|
999
|
-
* Return a function that produces ReactElements of a given type.
|
|
1000
|
-
* See https://reactjs.org/docs/react-api.html#createfactory
|
|
1001
|
-
*/
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
808
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
1005
809
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
1006
810
|
return newElement;
|
|
@@ -1013,7 +817,7 @@ function cloneAndReplaceKey(oldElement, newKey) {
|
|
|
1013
817
|
function cloneElement(element, config, children) {
|
|
1014
818
|
if (!!(element === null || element === undefined)) {
|
|
1015
819
|
{
|
|
1016
|
-
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
820
|
+
throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
|
|
1017
821
|
}
|
|
1018
822
|
}
|
|
1019
823
|
|
|
@@ -1222,13 +1026,6 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1222
1026
|
var iteratorFn = getIteratorFn(children);
|
|
1223
1027
|
|
|
1224
1028
|
if (typeof iteratorFn === 'function') {
|
|
1225
|
-
if (disableMapsAsChildren) {
|
|
1226
|
-
if (!(iteratorFn !== children.entries)) {
|
|
1227
|
-
{
|
|
1228
|
-
throw Error("Maps are not valid as a React child (found: " + children + "). Consider converting children to an array of keyed ReactElements instead.");
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
1029
|
|
|
1233
1030
|
{
|
|
1234
1031
|
// Warn about using Maps as children
|
|
@@ -1261,7 +1058,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1261
1058
|
|
|
1262
1059
|
{
|
|
1263
1060
|
{
|
|
1264
|
-
throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
|
|
1061
|
+
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum );
|
|
1265
1062
|
}
|
|
1266
1063
|
}
|
|
1267
1064
|
}
|
|
@@ -1451,7 +1248,7 @@ function toArray(children) {
|
|
|
1451
1248
|
function onlyChild(children) {
|
|
1452
1249
|
if (!isValidElement(children)) {
|
|
1453
1250
|
{
|
|
1454
|
-
throw Error("React.Children.only expected to receive a single React element child.");
|
|
1251
|
+
throw Error( "React.Children.only expected to receive a single React element child." );
|
|
1455
1252
|
}
|
|
1456
1253
|
}
|
|
1457
1254
|
|
|
@@ -1643,7 +1440,7 @@ function forwardRef(render) {
|
|
|
1643
1440
|
|
|
1644
1441
|
function isValidElementType(type) {
|
|
1645
1442
|
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1646
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof ===
|
|
1443
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
1647
1444
|
}
|
|
1648
1445
|
|
|
1649
1446
|
function memo(type, compare) {
|
|
@@ -1660,33 +1457,33 @@ function memo(type, compare) {
|
|
|
1660
1457
|
};
|
|
1661
1458
|
}
|
|
1662
1459
|
|
|
1663
|
-
function
|
|
1460
|
+
function block(query, render) {
|
|
1664
1461
|
{
|
|
1665
1462
|
if (typeof query !== 'function') {
|
|
1666
|
-
error('
|
|
1463
|
+
error('Blocks require a query function but was given %s.', query === null ? 'null' : typeof query);
|
|
1667
1464
|
}
|
|
1668
1465
|
|
|
1669
1466
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1670
|
-
error('
|
|
1467
|
+
error('Blocks require a render function but received a `memo` ' + 'component. Use `memo` on an inner component instead.');
|
|
1671
1468
|
} else if (render != null && render.$$typeof === REACT_FORWARD_REF_TYPE) {
|
|
1672
|
-
error('
|
|
1469
|
+
error('Blocks require a render function but received a `forwardRef` ' + 'component. Use `forwardRef` on an inner component instead.');
|
|
1673
1470
|
} else if (typeof render !== 'function') {
|
|
1674
|
-
error('
|
|
1471
|
+
error('Blocks require a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1675
1472
|
} else if (render.length !== 0 && render.length !== 2) {
|
|
1676
1473
|
// Warn if it's not accepting two args.
|
|
1677
1474
|
// Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
|
|
1678
|
-
error('
|
|
1475
|
+
error('Block render functions accept exactly two parameters: props and data. %s', render.length === 1 ? 'Did you forget to use the data parameter?' : 'Any additional parameter will be undefined.');
|
|
1679
1476
|
}
|
|
1680
1477
|
|
|
1681
1478
|
if (render != null && (render.defaultProps != null || render.propTypes != null)) {
|
|
1682
|
-
error('
|
|
1479
|
+
error('Block render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
|
1683
1480
|
}
|
|
1684
1481
|
}
|
|
1685
1482
|
|
|
1686
1483
|
return function () {
|
|
1687
1484
|
var args = arguments;
|
|
1688
1485
|
return {
|
|
1689
|
-
$$typeof:
|
|
1486
|
+
$$typeof: REACT_BLOCK_TYPE,
|
|
1690
1487
|
query: function () {
|
|
1691
1488
|
return query.apply(null, args);
|
|
1692
1489
|
},
|
|
@@ -1700,7 +1497,7 @@ function resolveDispatcher() {
|
|
|
1700
1497
|
|
|
1701
1498
|
if (!(dispatcher !== null)) {
|
|
1702
1499
|
{
|
|
1703
|
-
throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
|
|
1500
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." );
|
|
1704
1501
|
}
|
|
1705
1502
|
}
|
|
1706
1503
|
|
|
@@ -1768,20 +1565,6 @@ function useDebugValue(value, formatterFn) {
|
|
|
1768
1565
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1769
1566
|
}
|
|
1770
1567
|
}
|
|
1771
|
-
var emptyObject$1 = {};
|
|
1772
|
-
function useResponder(responder, listenerProps) {
|
|
1773
|
-
var dispatcher = resolveDispatcher();
|
|
1774
|
-
|
|
1775
|
-
{
|
|
1776
|
-
if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
|
|
1777
|
-
error('useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
|
|
1778
|
-
|
|
1779
|
-
return;
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
|
|
1784
|
-
}
|
|
1785
1568
|
function useTransition(config) {
|
|
1786
1569
|
var dispatcher = resolveDispatcher();
|
|
1787
1570
|
return dispatcher.useTransition(config);
|
|
@@ -1802,20 +1585,12 @@ function withSuspenseConfig(scope, config) {
|
|
|
1802
1585
|
}
|
|
1803
1586
|
}
|
|
1804
1587
|
|
|
1805
|
-
/**
|
|
1806
|
-
* ReactElementValidator provides a wrapper around a element factory
|
|
1807
|
-
* which validates the props passed to the element. This is intended to be
|
|
1808
|
-
* used only in DEV and could be replaced by a static type checker for languages
|
|
1809
|
-
* that support it.
|
|
1810
|
-
*/
|
|
1811
1588
|
var propTypesMisspellWarningShown;
|
|
1812
1589
|
|
|
1813
1590
|
{
|
|
1814
1591
|
propTypesMisspellWarningShown = false;
|
|
1815
1592
|
}
|
|
1816
1593
|
|
|
1817
|
-
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1818
|
-
|
|
1819
1594
|
function getDeclarationErrorAddendum() {
|
|
1820
1595
|
if (ReactCurrentOwner.current) {
|
|
1821
1596
|
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
@@ -2031,104 +1806,6 @@ function validateFragmentProps(fragment) {
|
|
|
2031
1806
|
setCurrentlyValidatingElement(null);
|
|
2032
1807
|
}
|
|
2033
1808
|
}
|
|
2034
|
-
|
|
2035
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
2036
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2037
|
-
// succeed and there will likely be errors in render.
|
|
2038
|
-
|
|
2039
|
-
if (!validType) {
|
|
2040
|
-
var info = '';
|
|
2041
|
-
|
|
2042
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2043
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
2047
|
-
|
|
2048
|
-
if (sourceInfo) {
|
|
2049
|
-
info += sourceInfo;
|
|
2050
|
-
} else {
|
|
2051
|
-
info += getDeclarationErrorAddendum();
|
|
2052
|
-
}
|
|
2053
|
-
|
|
2054
|
-
var typeString;
|
|
2055
|
-
|
|
2056
|
-
if (type === null) {
|
|
2057
|
-
typeString = 'null';
|
|
2058
|
-
} else if (Array.isArray(type)) {
|
|
2059
|
-
typeString = 'array';
|
|
2060
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2061
|
-
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
2062
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2063
|
-
} else {
|
|
2064
|
-
typeString = typeof type;
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
{
|
|
2068
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
2073
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
2074
|
-
|
|
2075
|
-
if (element == null) {
|
|
2076
|
-
return element;
|
|
2077
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
2078
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
2079
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
2080
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
2081
|
-
// fixed, the key warnings will appear.)
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
if (validType) {
|
|
2085
|
-
var children = props.children;
|
|
2086
|
-
|
|
2087
|
-
if (children !== undefined) {
|
|
2088
|
-
if (isStaticChildren) {
|
|
2089
|
-
if (Array.isArray(children)) {
|
|
2090
|
-
for (var i = 0; i < children.length; i++) {
|
|
2091
|
-
validateChildKeys(children[i], type);
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
if (Object.freeze) {
|
|
2095
|
-
Object.freeze(children);
|
|
2096
|
-
}
|
|
2097
|
-
} else {
|
|
2098
|
-
{
|
|
2099
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
} else {
|
|
2103
|
-
validateChildKeys(children, type);
|
|
2104
|
-
}
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
if (hasOwnProperty$1.call(props, 'key')) {
|
|
2109
|
-
{
|
|
2110
|
-
error('React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
2115
|
-
validateFragmentProps(element);
|
|
2116
|
-
} else {
|
|
2117
|
-
validatePropTypes(element);
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
return element;
|
|
2121
|
-
} // These two functions exist to still get child warnings in dev
|
|
2122
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
2123
|
-
// opt-in behavior for better messages but that we won't stop
|
|
2124
|
-
// giving you warnings if you use production apis.
|
|
2125
|
-
|
|
2126
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
2127
|
-
return jsxWithValidation(type, props, key, true);
|
|
2128
|
-
}
|
|
2129
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
2130
|
-
return jsxWithValidation(type, props, key, false);
|
|
2131
|
-
}
|
|
2132
1809
|
function createElementWithValidation(type, props, children) {
|
|
2133
1810
|
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2134
1811
|
// succeed and there will likely be errors in render.
|
|
@@ -2231,10 +1908,7 @@ function cloneElementWithValidation(element, props, children) {
|
|
|
2231
1908
|
return newElement;
|
|
2232
1909
|
}
|
|
2233
1910
|
|
|
2234
|
-
var hasBadMapPolyfill;
|
|
2235
|
-
|
|
2236
1911
|
{
|
|
2237
|
-
hasBadMapPolyfill = false;
|
|
2238
1912
|
|
|
2239
1913
|
try {
|
|
2240
1914
|
var frozenObject = Object.freeze({});
|
|
@@ -2246,164 +1920,52 @@ var hasBadMapPolyfill;
|
|
|
2246
1920
|
testMap.set(0, 0);
|
|
2247
1921
|
testSet.add(0);
|
|
2248
1922
|
} catch (e) {
|
|
2249
|
-
// TODO: Consider warning about bad polyfills
|
|
2250
|
-
hasBadMapPolyfill = true;
|
|
2251
1923
|
}
|
|
2252
1924
|
}
|
|
2253
1925
|
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
$$typeof: REACT_FUNDAMENTAL_TYPE,
|
|
2264
|
-
impl: impl
|
|
2265
|
-
};
|
|
2266
|
-
|
|
2267
|
-
{
|
|
2268
|
-
Object.freeze(fundamantalComponent);
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
|
-
return fundamantalComponent;
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
function createEventResponder(displayName, responderConfig) {
|
|
2275
|
-
var getInitialState = responderConfig.getInitialState,
|
|
2276
|
-
onEvent = responderConfig.onEvent,
|
|
2277
|
-
onMount = responderConfig.onMount,
|
|
2278
|
-
onUnmount = responderConfig.onUnmount,
|
|
2279
|
-
onRootEvent = responderConfig.onRootEvent,
|
|
2280
|
-
rootEventTypes = responderConfig.rootEventTypes,
|
|
2281
|
-
targetEventTypes = responderConfig.targetEventTypes,
|
|
2282
|
-
targetPortalPropagation = responderConfig.targetPortalPropagation;
|
|
2283
|
-
var eventResponder = {
|
|
2284
|
-
$$typeof: REACT_RESPONDER_TYPE,
|
|
2285
|
-
displayName: displayName,
|
|
2286
|
-
getInitialState: getInitialState || null,
|
|
2287
|
-
onEvent: onEvent || null,
|
|
2288
|
-
onMount: onMount || null,
|
|
2289
|
-
onRootEvent: onRootEvent || null,
|
|
2290
|
-
onUnmount: onUnmount || null,
|
|
2291
|
-
rootEventTypes: rootEventTypes || null,
|
|
2292
|
-
targetEventTypes: targetEventTypes || null,
|
|
2293
|
-
targetPortalPropagation: targetPortalPropagation || false
|
|
2294
|
-
}; // We use responder as a Map key later on. When we have a bad
|
|
2295
|
-
// polyfill, then we can't use it as a key as the polyfill tries
|
|
2296
|
-
// to add a property to the object.
|
|
2297
|
-
|
|
2298
|
-
if (true && !hasBadMapPolyfill) {
|
|
2299
|
-
Object.freeze(eventResponder);
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
return eventResponder;
|
|
2303
|
-
}
|
|
2304
|
-
|
|
2305
|
-
function createScope() {
|
|
2306
|
-
var scopeComponent = {
|
|
2307
|
-
$$typeof: REACT_SCOPE_TYPE
|
|
2308
|
-
};
|
|
2309
|
-
|
|
2310
|
-
{
|
|
2311
|
-
Object.freeze(scopeComponent);
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
return scopeComponent;
|
|
2315
|
-
}
|
|
2316
|
-
|
|
2317
|
-
var React = {
|
|
2318
|
-
Children: {
|
|
2319
|
-
map: mapChildren,
|
|
2320
|
-
forEach: forEachChildren,
|
|
2321
|
-
count: countChildren,
|
|
2322
|
-
toArray: toArray,
|
|
2323
|
-
only: onlyChild
|
|
2324
|
-
},
|
|
2325
|
-
createRef: createRef,
|
|
2326
|
-
Component: Component,
|
|
2327
|
-
PureComponent: PureComponent,
|
|
2328
|
-
createContext: createContext,
|
|
2329
|
-
forwardRef: forwardRef,
|
|
2330
|
-
lazy: lazy,
|
|
2331
|
-
memo: memo,
|
|
2332
|
-
useCallback: useCallback,
|
|
2333
|
-
useContext: useContext,
|
|
2334
|
-
useEffect: useEffect,
|
|
2335
|
-
useImperativeHandle: useImperativeHandle,
|
|
2336
|
-
useDebugValue: useDebugValue,
|
|
2337
|
-
useLayoutEffect: useLayoutEffect,
|
|
2338
|
-
useMemo: useMemo,
|
|
2339
|
-
useReducer: useReducer,
|
|
2340
|
-
useRef: useRef,
|
|
2341
|
-
useState: useState,
|
|
2342
|
-
Fragment: REACT_FRAGMENT_TYPE,
|
|
2343
|
-
Profiler: REACT_PROFILER_TYPE,
|
|
2344
|
-
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
2345
|
-
Suspense: REACT_SUSPENSE_TYPE,
|
|
2346
|
-
createElement: createElementWithValidation,
|
|
2347
|
-
cloneElement: cloneElementWithValidation,
|
|
2348
|
-
isValidElement: isValidElement,
|
|
2349
|
-
version: ReactVersion,
|
|
2350
|
-
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
1926
|
+
var createElement$1 = createElementWithValidation ;
|
|
1927
|
+
var cloneElement$1 = cloneElementWithValidation ;
|
|
1928
|
+
var createFactory = createFactoryWithValidation ;
|
|
1929
|
+
var Children = {
|
|
1930
|
+
map: mapChildren,
|
|
1931
|
+
forEach: forEachChildren,
|
|
1932
|
+
count: countChildren,
|
|
1933
|
+
toArray: toArray,
|
|
1934
|
+
only: onlyChild
|
|
2351
1935
|
};
|
|
2352
1936
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
{
|
|
2387
|
-
React.jsxDEV = jsxWithValidation;
|
|
2388
|
-
React.jsx = jsxWithValidationDynamic;
|
|
2389
|
-
React.jsxs = jsxWithValidationStatic;
|
|
2390
|
-
}
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
var React$2 = Object.freeze({
|
|
2396
|
-
default: React
|
|
2397
|
-
});
|
|
2398
|
-
|
|
2399
|
-
var React$3 = ( React$2 && React ) || React$2;
|
|
2400
|
-
|
|
2401
|
-
// TODO: decide on the top-level export form.
|
|
2402
|
-
// This is hacky but makes it work with both Rollup and Jest.
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
var react = React$3.default || React$3;
|
|
2406
|
-
|
|
2407
|
-
module.exports = react;
|
|
1937
|
+
exports.Children = Children;
|
|
1938
|
+
exports.Component = Component;
|
|
1939
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1940
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1941
|
+
exports.PureComponent = PureComponent;
|
|
1942
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1943
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1944
|
+
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
1945
|
+
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
1946
|
+
exports.block = block;
|
|
1947
|
+
exports.cloneElement = cloneElement$1;
|
|
1948
|
+
exports.createContext = createContext;
|
|
1949
|
+
exports.createElement = createElement$1;
|
|
1950
|
+
exports.createFactory = createFactory;
|
|
1951
|
+
exports.createRef = createRef;
|
|
1952
|
+
exports.forwardRef = forwardRef;
|
|
1953
|
+
exports.isValidElement = isValidElement;
|
|
1954
|
+
exports.lazy = lazy;
|
|
1955
|
+
exports.memo = memo;
|
|
1956
|
+
exports.unstable_withSuspenseConfig = withSuspenseConfig;
|
|
1957
|
+
exports.useCallback = useCallback;
|
|
1958
|
+
exports.useContext = useContext;
|
|
1959
|
+
exports.useDebugValue = useDebugValue;
|
|
1960
|
+
exports.useDeferredValue = useDeferredValue;
|
|
1961
|
+
exports.useEffect = useEffect;
|
|
1962
|
+
exports.useImperativeHandle = useImperativeHandle;
|
|
1963
|
+
exports.useLayoutEffect = useLayoutEffect;
|
|
1964
|
+
exports.useMemo = useMemo;
|
|
1965
|
+
exports.useReducer = useReducer;
|
|
1966
|
+
exports.useRef = useRef;
|
|
1967
|
+
exports.useState = useState;
|
|
1968
|
+
exports.useTransition = useTransition;
|
|
1969
|
+
exports.version = ReactVersion;
|
|
2408
1970
|
})();
|
|
2409
1971
|
}
|