react 19.0.0-canary-33a32441e9-20240418 → 19.0.0-canary-db913d8e17-20240422

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.
Files changed (32) hide show
  1. package/cjs/react-jsx-dev-runtime.development.js +7 -4
  2. package/cjs/react-jsx-dev-runtime.production.js +4 -9
  3. package/cjs/react-jsx-dev-runtime.profiling.js +4 -9
  4. package/cjs/react-jsx-runtime.development.js +7 -4
  5. package/cjs/react-jsx-runtime.production.js +24 -144
  6. package/cjs/react-jsx-runtime.profiling.js +24 -144
  7. package/cjs/react-jsx-runtime.react-server.development.js +7 -4
  8. package/cjs/react-jsx-runtime.react-server.production.js +29 -151
  9. package/cjs/react.development.js +18 -8
  10. package/cjs/react.production.js +469 -1029
  11. package/cjs/react.react-server.development.js +8 -5
  12. package/cjs/react.react-server.production.js +479 -986
  13. package/index.js +1 -1
  14. package/jsx-dev-runtime.js +1 -1
  15. package/jsx-runtime.js +1 -1
  16. package/jsx-runtime.react-server.js +1 -1
  17. package/package.json +1 -1
  18. package/react.react-server.js +1 -1
  19. package/cjs/react-jsx-dev-runtime.production.min.js +0 -12
  20. package/cjs/react-jsx-dev-runtime.production.min.js.map +0 -1
  21. package/cjs/react-jsx-dev-runtime.profiling.min.js +0 -12
  22. package/cjs/react-jsx-dev-runtime.profiling.min.js.map +0 -1
  23. package/cjs/react-jsx-runtime.production.min.js +0 -12
  24. package/cjs/react-jsx-runtime.production.min.js.map +0 -1
  25. package/cjs/react-jsx-runtime.profiling.min.js +0 -12
  26. package/cjs/react-jsx-runtime.profiling.min.js.map +0 -1
  27. package/cjs/react-jsx-runtime.react-server.production.min.js +0 -13
  28. package/cjs/react-jsx-runtime.react-server.production.min.js.map +0 -1
  29. package/cjs/react.production.min.js +0 -30
  30. package/cjs/react.production.min.js.map +0 -1
  31. package/cjs/react.react-server.production.min.js +0 -29
  32. package/cjs/react.react-server.production.min.js.map +0 -1
@@ -1132,11 +1132,14 @@ function validateChildKeys(node, parentType) {
1132
1132
  // but now we print a separate warning for them later.
1133
1133
  if (iteratorFn !== node.entries) {
1134
1134
  var iterator = iteratorFn.call(node);
1135
- var step;
1136
1135
 
1137
- while (!(step = iterator.next()).done) {
1138
- if (isValidElement(step.value)) {
1139
- validateExplicitKey(step.value, parentType);
1136
+ if (iterator !== node) {
1137
+ var step;
1138
+
1139
+ while (!(step = iterator.next()).done) {
1140
+ if (isValidElement(step.value)) {
1141
+ validateExplicitKey(step.value, parentType);
1142
+ }
1140
1143
  }
1141
1144
  }
1142
1145
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-jsx-dev-runtime.production.min.js
3
+ * react-jsx-dev-runtime.production.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,12 +8,7 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- // ATTENTION
14
- const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
15
-
16
- const jsxDEV = undefined;
17
-
11
+ "use strict";
12
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
18
13
  exports.Fragment = REACT_FRAGMENT_TYPE;
19
- exports.jsxDEV = jsxDEV;
14
+ exports.jsxDEV = void 0;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-jsx-dev-runtime.profiling.min.js
3
+ * react-jsx-dev-runtime.profiling.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,12 +8,7 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- // ATTENTION
14
- const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
15
-
16
- const jsxDEV = undefined;
17
-
11
+ "use strict";
12
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
18
13
  exports.Fragment = REACT_FRAGMENT_TYPE;
19
- exports.jsxDEV = jsxDEV;
14
+ exports.jsxDEV = void 0;
@@ -1156,11 +1156,14 @@ function validateChildKeys(node, parentType) {
1156
1156
  // but now we print a separate warning for them later.
1157
1157
  if (iteratorFn !== node.entries) {
1158
1158
  var iterator = iteratorFn.call(node);
1159
- var step;
1160
1159
 
1161
- while (!(step = iterator.next()).done) {
1162
- if (isValidElement(step.value)) {
1163
- validateExplicitKey(step.value, parentType);
1160
+ if (iterator !== node) {
1161
+ var step;
1162
+
1163
+ while (!(step = iterator.next()).done) {
1164
+ if (isValidElement(step.value)) {
1165
+ validateExplicitKey(step.value, parentType);
1166
+ }
1164
1167
  }
1165
1168
  }
1166
1169
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-jsx-runtime.production.min.js
3
+ * react-jsx-runtime.production.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,148 +8,28 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- var React = require('react');
14
-
15
- // ATTENTION
16
- // When adding new symbols to this file,
17
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
18
- // The Symbol used to tag the ReactElement-like types.
19
- const REACT_ELEMENT_TYPE = Symbol.for('react.element');
20
- const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
21
-
22
- // -----------------------------------------------------------------------------
23
- // as a normal prop instead of stripping it from the props object.
24
- // Passes `ref` as a normal prop instead of stripping it from the props object
25
- // during element creation.
26
-
27
- const enableRefAsProp = true;
28
-
29
- const ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
30
-
31
- function hasValidKey(config) {
32
-
33
- return config.key !== undefined;
34
- }
35
- /**
36
- * Factory method to create a new React element. This no longer adheres to
37
- * the class pattern, so do not use new to call it. Also, instanceof check
38
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
39
- * if something is a React Element.
40
- *
41
- * @param {*} type
42
- * @param {*} props
43
- * @param {*} key
44
- * @param {string|object} ref
45
- * @param {*} owner
46
- * @param {*} self A *temporary* helper to detect places where `this` is
47
- * different from the `owner` when React.createElement is called, so that we
48
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
49
- * functions, and as long as `this` and owner are the same, there will be no
50
- * change in behavior.
51
- * @param {*} source An annotation object (added by a transpiler or otherwise)
52
- * indicating filename, line number, and/or other information.
53
- * @internal
54
- */
55
-
56
-
57
- function ReactElement(type, key, _ref, self, source, owner, props) {
58
- let ref;
59
-
60
- {
61
- // When enableRefAsProp is on, ignore whatever was passed as the ref
62
- // argument and treat `props.ref` as the source of truth. The only thing we
63
- // use this for is `element.ref`, which will log a deprecation warning on
64
- // access. In the next release, we can remove `element.ref` as well as the
65
- // `ref` argument.
66
- const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
67
- // backwards compatibility.
68
-
69
- ref = refProp !== undefined ? refProp : null;
70
- }
71
-
72
- let element;
73
-
74
- {
75
- // In prod, `ref` is a regular property and _owner doesn't exist.
76
- element = {
77
- // This tag allows us to uniquely identify this as a React Element
78
- $$typeof: REACT_ELEMENT_TYPE,
79
- // Built-in properties that belong on the element
80
- type,
81
- key,
82
- ref,
83
- props
84
- };
85
- }
86
-
87
- return element;
88
- }
89
- /**
90
- * https://github.com/reactjs/rfcs/pull/107
91
- * @param {*} type
92
- * @param {object} props
93
- * @param {string} key
94
- */
95
-
96
-
11
+ "use strict";
12
+ require("react");
13
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
14
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
97
15
  function jsxProd(type, config, maybeKey) {
98
- let key = null;
99
- let ref = null; // Currently, key can be spread in as a prop. This causes a potential
100
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
101
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
102
- // but as an intermediary step, we will use jsxDEV for everything except
103
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
104
- // key is explicitly declared to be undefined or not.
105
-
106
- if (maybeKey !== undefined) {
107
-
108
- key = '' + maybeKey;
109
- }
110
-
111
- if (hasValidKey(config)) {
112
-
113
- key = '' + config.key;
114
- }
115
-
116
- let props;
117
-
118
- if (!('key' in config)) {
119
- // If key was not spread in, we can reuse the original props object. This
120
- // only works for `jsx`, not `createElement`, because `jsx` is a compiler
121
- // target and the compiler always passes a new object. For `createElement`,
122
- // we can't assume a new object is passed every time because it can be
123
- // called manually.
124
- //
125
- // Spreading key is a warning in dev. In a future release, we will not
126
- // remove a spread key from the props object. (But we'll still warn.) We'll
127
- // always pass the object straight through.
128
- props = config;
129
- } else {
130
- // We need to remove reserved props (key, prop, ref). Create a fresh props
131
- // object and copy over all the non-reserved props. We don't use `delete`
132
- // because in V8 it will deopt the object to dictionary mode.
133
- props = {};
134
-
135
- for (const propName in config) {
136
- // Skip over reserved prop names
137
- if (propName !== 'key' && (enableRefAsProp )) {
138
- {
139
- props[propName] = config[propName];
140
- }
141
- }
142
- }
143
- }
144
-
145
- return ReactElement(type, key, ref, undefined, undefined, ReactSharedInternals.owner, props);
146
- } // While `jsxDEV` should never be called when running in production, we do
147
-
148
- const jsx = jsxProd; // we may want to special case jsxs internally to take advantage of static children.
149
- // for now we can ship identical prod functions
150
-
151
- const jsxs = jsxProd;
152
-
16
+ var key = null;
17
+ void 0 !== maybeKey && (key = "" + maybeKey);
18
+ void 0 !== config.key && (key = "" + config.key);
19
+ if ("key" in config) {
20
+ maybeKey = {};
21
+ for (var propName in config)
22
+ "key" !== propName && (maybeKey[propName] = config[propName]);
23
+ } else maybeKey = config;
24
+ config = maybeKey.ref;
25
+ return {
26
+ $$typeof: REACT_ELEMENT_TYPE,
27
+ type: type,
28
+ key: key,
29
+ ref: void 0 !== config ? config : null,
30
+ props: maybeKey
31
+ };
32
+ }
153
33
  exports.Fragment = REACT_FRAGMENT_TYPE;
154
- exports.jsx = jsx;
155
- exports.jsxs = jsxs;
34
+ exports.jsx = jsxProd;
35
+ exports.jsxs = jsxProd;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-jsx-runtime.profiling.min.js
3
+ * react-jsx-runtime.profiling.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,148 +8,28 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- var React = require('react');
14
-
15
- // ATTENTION
16
- // When adding new symbols to this file,
17
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
18
- // The Symbol used to tag the ReactElement-like types.
19
- const REACT_ELEMENT_TYPE = Symbol.for('react.element');
20
- const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
21
-
22
- // -----------------------------------------------------------------------------
23
- // as a normal prop instead of stripping it from the props object.
24
- // Passes `ref` as a normal prop instead of stripping it from the props object
25
- // during element creation.
26
-
27
- const enableRefAsProp = true;
28
-
29
- const ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
30
-
31
- function hasValidKey(config) {
32
-
33
- return config.key !== undefined;
34
- }
35
- /**
36
- * Factory method to create a new React element. This no longer adheres to
37
- * the class pattern, so do not use new to call it. Also, instanceof check
38
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
39
- * if something is a React Element.
40
- *
41
- * @param {*} type
42
- * @param {*} props
43
- * @param {*} key
44
- * @param {string|object} ref
45
- * @param {*} owner
46
- * @param {*} self A *temporary* helper to detect places where `this` is
47
- * different from the `owner` when React.createElement is called, so that we
48
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
49
- * functions, and as long as `this` and owner are the same, there will be no
50
- * change in behavior.
51
- * @param {*} source An annotation object (added by a transpiler or otherwise)
52
- * indicating filename, line number, and/or other information.
53
- * @internal
54
- */
55
-
56
-
57
- function ReactElement(type, key, _ref, self, source, owner, props) {
58
- let ref;
59
-
60
- {
61
- // When enableRefAsProp is on, ignore whatever was passed as the ref
62
- // argument and treat `props.ref` as the source of truth. The only thing we
63
- // use this for is `element.ref`, which will log a deprecation warning on
64
- // access. In the next release, we can remove `element.ref` as well as the
65
- // `ref` argument.
66
- const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
67
- // backwards compatibility.
68
-
69
- ref = refProp !== undefined ? refProp : null;
70
- }
71
-
72
- let element;
73
-
74
- {
75
- // In prod, `ref` is a regular property and _owner doesn't exist.
76
- element = {
77
- // This tag allows us to uniquely identify this as a React Element
78
- $$typeof: REACT_ELEMENT_TYPE,
79
- // Built-in properties that belong on the element
80
- type,
81
- key,
82
- ref,
83
- props
84
- };
85
- }
86
-
87
- return element;
88
- }
89
- /**
90
- * https://github.com/reactjs/rfcs/pull/107
91
- * @param {*} type
92
- * @param {object} props
93
- * @param {string} key
94
- */
95
-
96
-
11
+ "use strict";
12
+ require("react");
13
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
14
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
97
15
  function jsxProd(type, config, maybeKey) {
98
- let key = null;
99
- let ref = null; // Currently, key can be spread in as a prop. This causes a potential
100
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
101
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
102
- // but as an intermediary step, we will use jsxDEV for everything except
103
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
104
- // key is explicitly declared to be undefined or not.
105
-
106
- if (maybeKey !== undefined) {
107
-
108
- key = '' + maybeKey;
109
- }
110
-
111
- if (hasValidKey(config)) {
112
-
113
- key = '' + config.key;
114
- }
115
-
116
- let props;
117
-
118
- if (!('key' in config)) {
119
- // If key was not spread in, we can reuse the original props object. This
120
- // only works for `jsx`, not `createElement`, because `jsx` is a compiler
121
- // target and the compiler always passes a new object. For `createElement`,
122
- // we can't assume a new object is passed every time because it can be
123
- // called manually.
124
- //
125
- // Spreading key is a warning in dev. In a future release, we will not
126
- // remove a spread key from the props object. (But we'll still warn.) We'll
127
- // always pass the object straight through.
128
- props = config;
129
- } else {
130
- // We need to remove reserved props (key, prop, ref). Create a fresh props
131
- // object and copy over all the non-reserved props. We don't use `delete`
132
- // because in V8 it will deopt the object to dictionary mode.
133
- props = {};
134
-
135
- for (const propName in config) {
136
- // Skip over reserved prop names
137
- if (propName !== 'key' && (enableRefAsProp )) {
138
- {
139
- props[propName] = config[propName];
140
- }
141
- }
142
- }
143
- }
144
-
145
- return ReactElement(type, key, ref, undefined, undefined, ReactSharedInternals.owner, props);
146
- } // While `jsxDEV` should never be called when running in production, we do
147
-
148
- const jsx = jsxProd; // we may want to special case jsxs internally to take advantage of static children.
149
- // for now we can ship identical prod functions
150
-
151
- const jsxs = jsxProd;
152
-
16
+ var key = null;
17
+ void 0 !== maybeKey && (key = "" + maybeKey);
18
+ void 0 !== config.key && (key = "" + config.key);
19
+ if ("key" in config) {
20
+ maybeKey = {};
21
+ for (var propName in config)
22
+ "key" !== propName && (maybeKey[propName] = config[propName]);
23
+ } else maybeKey = config;
24
+ config = maybeKey.ref;
25
+ return {
26
+ $$typeof: REACT_ELEMENT_TYPE,
27
+ type: type,
28
+ key: key,
29
+ ref: void 0 !== config ? config : null,
30
+ props: maybeKey
31
+ };
32
+ }
153
33
  exports.Fragment = REACT_FRAGMENT_TYPE;
154
- exports.jsx = jsx;
155
- exports.jsxs = jsxs;
34
+ exports.jsx = jsxProd;
35
+ exports.jsxs = jsxProd;
@@ -1161,11 +1161,14 @@ function validateChildKeys(node, parentType) {
1161
1161
  // but now we print a separate warning for them later.
1162
1162
  if (iteratorFn !== node.entries) {
1163
1163
  var iterator = iteratorFn.call(node);
1164
- var step;
1165
1164
 
1166
- while (!(step = iterator.next()).done) {
1167
- if (isValidElement(step.value)) {
1168
- validateExplicitKey(step.value, parentType);
1165
+ if (iterator !== node) {
1166
+ var step;
1167
+
1168
+ while (!(step = iterator.next()).done) {
1169
+ if (isValidElement(step.value)) {
1170
+ validateExplicitKey(step.value, parentType);
1171
+ }
1169
1172
  }
1170
1173
  }
1171
1174
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-jsx-runtime.react-server.production.min.js
3
+ * react-jsx-runtime.react-server.production.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,155 +8,33 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- var React = require('react');
14
-
15
- // ATTENTION
16
- // When adding new symbols to this file,
17
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
18
- // The Symbol used to tag the ReactElement-like types.
19
- const REACT_ELEMENT_TYPE = Symbol.for('react.element');
20
- const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
21
-
22
- // -----------------------------------------------------------------------------
23
- // as a normal prop instead of stripping it from the props object.
24
- // Passes `ref` as a normal prop instead of stripping it from the props object
25
- // during element creation.
26
-
27
- const enableRefAsProp = true;
28
-
29
- const ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
30
- React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
31
-
32
- if (!ReactSharedInternalsServer) {
33
- throw new Error('The "react" package in this environment is not configured correctly. ' + 'The "react-server" condition must be enabled in any environment that ' + 'runs React Server Components.');
34
- }
35
-
36
- function hasValidKey(config) {
37
-
38
- return config.key !== undefined;
39
- }
40
- /**
41
- * Factory method to create a new React element. This no longer adheres to
42
- * the class pattern, so do not use new to call it. Also, instanceof check
43
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
44
- * if something is a React Element.
45
- *
46
- * @param {*} type
47
- * @param {*} props
48
- * @param {*} key
49
- * @param {string|object} ref
50
- * @param {*} owner
51
- * @param {*} self A *temporary* helper to detect places where `this` is
52
- * different from the `owner` when React.createElement is called, so that we
53
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
54
- * functions, and as long as `this` and owner are the same, there will be no
55
- * change in behavior.
56
- * @param {*} source An annotation object (added by a transpiler or otherwise)
57
- * indicating filename, line number, and/or other information.
58
- * @internal
59
- */
60
-
61
-
62
- function ReactElement(type, key, _ref, self, source, owner, props) {
63
- let ref;
64
-
65
- {
66
- // When enableRefAsProp is on, ignore whatever was passed as the ref
67
- // argument and treat `props.ref` as the source of truth. The only thing we
68
- // use this for is `element.ref`, which will log a deprecation warning on
69
- // access. In the next release, we can remove `element.ref` as well as the
70
- // `ref` argument.
71
- const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
72
- // backwards compatibility.
73
-
74
- ref = refProp !== undefined ? refProp : null;
75
- }
76
-
77
- let element;
78
-
79
- {
80
- // In prod, `ref` is a regular property and _owner doesn't exist.
81
- element = {
82
- // This tag allows us to uniquely identify this as a React Element
83
- $$typeof: REACT_ELEMENT_TYPE,
84
- // Built-in properties that belong on the element
85
- type,
86
- key,
87
- ref,
88
- props
89
- };
90
- }
91
-
92
- return element;
93
- }
94
- /**
95
- * https://github.com/reactjs/rfcs/pull/107
96
- * @param {*} type
97
- * @param {object} props
98
- * @param {string} key
99
- */
100
-
101
-
11
+ "use strict";
12
+ var React = require("react"),
13
+ REACT_ELEMENT_TYPE = Symbol.for("react.element"),
14
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
15
+ if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
16
+ throw Error(
17
+ 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
18
+ );
102
19
  function jsxProd(type, config, maybeKey) {
103
- let key = null;
104
- let ref = null; // Currently, key can be spread in as a prop. This causes a potential
105
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
106
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
107
- // but as an intermediary step, we will use jsxDEV for everything except
108
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
109
- // key is explicitly declared to be undefined or not.
110
-
111
- if (maybeKey !== undefined) {
112
-
113
- key = '' + maybeKey;
114
- }
115
-
116
- if (hasValidKey(config)) {
117
-
118
- key = '' + config.key;
119
- }
120
-
121
- let props;
122
-
123
- if (!('key' in config)) {
124
- // If key was not spread in, we can reuse the original props object. This
125
- // only works for `jsx`, not `createElement`, because `jsx` is a compiler
126
- // target and the compiler always passes a new object. For `createElement`,
127
- // we can't assume a new object is passed every time because it can be
128
- // called manually.
129
- //
130
- // Spreading key is a warning in dev. In a future release, we will not
131
- // remove a spread key from the props object. (But we'll still warn.) We'll
132
- // always pass the object straight through.
133
- props = config;
134
- } else {
135
- // We need to remove reserved props (key, prop, ref). Create a fresh props
136
- // object and copy over all the non-reserved props. We don't use `delete`
137
- // because in V8 it will deopt the object to dictionary mode.
138
- props = {};
139
-
140
- for (const propName in config) {
141
- // Skip over reserved prop names
142
- if (propName !== 'key' && (enableRefAsProp )) {
143
- {
144
- props[propName] = config[propName];
145
- }
146
- }
147
- }
148
- }
149
-
150
- return ReactElement(type, key, ref, undefined, undefined, ReactSharedInternalsServer.owner, props);
151
- } // While `jsxDEV` should never be called when running in production, we do
152
-
153
- const jsx = jsxProd; // we may want to special case jsxs internally to take advantage of static children.
154
- // for now we can ship identical prod functions
155
-
156
- const jsxs = jsxProd;
157
- const jsxDEV = undefined;
158
-
20
+ var key = null;
21
+ void 0 !== maybeKey && (key = "" + maybeKey);
22
+ void 0 !== config.key && (key = "" + config.key);
23
+ if ("key" in config) {
24
+ maybeKey = {};
25
+ for (var propName in config)
26
+ "key" !== propName && (maybeKey[propName] = config[propName]);
27
+ } else maybeKey = config;
28
+ config = maybeKey.ref;
29
+ return {
30
+ $$typeof: REACT_ELEMENT_TYPE,
31
+ type: type,
32
+ key: key,
33
+ ref: void 0 !== config ? config : null,
34
+ props: maybeKey
35
+ };
36
+ }
159
37
  exports.Fragment = REACT_FRAGMENT_TYPE;
160
- exports.jsx = jsx;
161
- exports.jsxDEV = jsxDEV;
162
- exports.jsxs = jsxs;
38
+ exports.jsx = jsxProd;
39
+ exports.jsxDEV = void 0;
40
+ exports.jsxs = jsxProd;