GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Move createElement/JSX Warnings into the Renderer (#29088) · react/react@a817127

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • compiled-rn/facebook-fbsource/xplat/js
    • RKJSModules/vendor/react
      • react-is/cjs
        • ReactIs-dev.js
      • react-test-renderer/cjs
        • ReactTestRenderer-dev.js
        • ReactTestRenderer-prod.js
        • ReactTestRenderer-profiling.js
      • react/cjs
        • JSXDEVRuntime-dev.js
        • JSXRuntime-dev.js
        • React-dev.js
        • React-prod.js
        • React-profiling.js
    • react-native-github/Libraries/Renderer
      • REVISION
      • implementations
        • ReactFabric-dev.fb.js
        • ReactFabric-prod.fb.js
        • ReactFabric-profiling.fb.js
        • ReactNativeRenderer-dev.fb.js
        • ReactNativeRenderer-prod.fb.js
        • ReactNativeRenderer-profiling.fb.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-is/cjs/ReactIs-dev.js‎

Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-is/cjs/ReactIs-dev.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<cc5ff8fe75f7cb7812ce459378d61959>>
10+
* @generated SignedSource<<a12e42d980c252cd9449b3f2a99f483a>>
1111
*/
1212

1313
'use strict';
@@ -44,7 +44,9 @@ var REACT_MEMO_TYPE = Symbol.for('react.memo');
4444
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
4545
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
4646

47-
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
47+
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); // This function is deprecated. Don't use. Only the renderer knows what a valid type is.
48+
// TODO: Delete this when enableOwnerStacks ships.
49+
4850
function isValidElementType(type) {
4951
if (typeof type === 'string' || typeof type === 'function') {
5052
return true;
Collapse file

‎compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js‎

Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js
+114-15Lines changed: 114 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<98724556db7e01bfefca7439ac7adfc3>>
10+
* @generated SignedSource<<3f7c609322e65db1e2ce38a0f7c72577>>
1111
*/
1212

1313
'use strict';
@@ -55,11 +55,14 @@ function printWarning(level, format, args) {
5555
// update consoleWithStackDev.www.js as well.
5656
{
5757
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
58-
var stack = ReactSharedInternals.getStackAddendum();
5958

60-
if (stack !== '') {
61-
format += '%s';
62-
args = args.concat([stack]);
59+
if (ReactSharedInternals.getCurrentStack) {
60+
var stack = ReactSharedInternals.getCurrentStack();
61+
62+
if (stack !== '') {
63+
format += '%s';
64+
args = args.concat([stack]);
65+
}
6366
}
6467

6568
if (isErrorLogger) {
@@ -5631,7 +5634,7 @@ var warnForMissingKey = function (child, returnFiber) {};
56315634
return;
56325635
}
56335636

5634-
if (!child._store || child._store.validated || child.key != null) {
5637+
if (!child._store || (child._store.validated || child.key != null) && child._store.validated !== 2) {
56355638
return;
56365639
}
56375640

@@ -5640,17 +5643,96 @@ var warnForMissingKey = function (child, returnFiber) {};
56405643
} // $FlowFixMe[cannot-write] unable to narrow type from mixed to writable object
56415644

56425645

5643-
child._store.validated = true;
5644-
var componentName = getComponentNameFromFiber(returnFiber) || 'Component';
5646+
child._store.validated = 1;
5647+
var componentName = getComponentNameFromFiber(returnFiber);
5648+
var componentKey = componentName || 'null';
56455649

5646-
if (ownerHasKeyUseWarning[componentName]) {
5650+
if (ownerHasKeyUseWarning[componentKey]) {
56475651
return;
56485652
}
56495653

5650-
ownerHasKeyUseWarning[componentName] = true;
5654+
ownerHasKeyUseWarning[componentKey] = true;
5655+
var childOwner = child._owner;
5656+
var parentOwner = returnFiber._debugOwner;
5657+
var currentComponentErrorInfo = '';
5658+
5659+
if (parentOwner && typeof parentOwner.tag === 'number') {
5660+
var name = getComponentNameFromFiber(parentOwner);
5661+
5662+
if (name) {
5663+
currentComponentErrorInfo = '\n\nCheck the render method of `' + name + '`.';
5664+
}
5665+
}
5666+
5667+
if (!currentComponentErrorInfo) {
5668+
if (componentName) {
5669+
currentComponentErrorInfo = "\n\nCheck the top-level render call using <" + componentName + ">.";
5670+
}
5671+
} // Usually the current owner is the offender, but if it accepts children as a
5672+
// property, it may be the creator of the child that's responsible for
5673+
// assigning it a key.
5674+
5675+
5676+
var childOwnerAppendix = '';
5677+
5678+
if (childOwner != null && parentOwner !== childOwner) {
5679+
var ownerName = null;
5680+
5681+
if (typeof childOwner.tag === 'number') {
5682+
ownerName = getComponentNameFromFiber(childOwner);
5683+
} else if (typeof childOwner.name === 'string') {
5684+
ownerName = childOwner.name;
5685+
}
5686+
5687+
if (ownerName) {
5688+
// Give the component that originally created this child.
5689+
childOwnerAppendix = " It was passed a child from " + ownerName + ".";
5690+
}
5691+
} // We create a fake Fiber for the child to log the stack trace from.
5692+
// TODO: Refactor the warnForMissingKey calls to happen after fiber creation
5693+
// so that we can get access to the fiber that will eventually be created.
5694+
// That way the log can show up associated with the right instance in DevTools.
5695+
5696+
5697+
var fiber = createFiberFromElement(child, returnFiber.mode, 0);
5698+
fiber.return = returnFiber;
5699+
var prevDebugFiber = getCurrentFiber();
5700+
setCurrentFiber(fiber);
5701+
5702+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://react.dev/link/warning-keys for more information.', currentComponentErrorInfo, childOwnerAppendix);
56515703

5652-
error('Each child in a list should have a unique ' + '"key" prop. See https://react.dev/link/warning-keys for ' + 'more information.');
5704+
setCurrentFiber(prevDebugFiber);
56535705
};
5706+
} // Given a fragment, validate that it can only be provided with fragment props
5707+
// We do this here instead of BeginWork because the Fragment fiber doesn't have
5708+
// the whole props object, only the children and is shared with arrays.
5709+
5710+
5711+
function validateFragmentProps(element, fiber, returnFiber) {
5712+
{
5713+
var keys = Object.keys(element.props);
5714+
5715+
for (var i = 0; i < keys.length; i++) {
5716+
var key = keys[i];
5717+
5718+
if (key !== 'children' && key !== 'key') {
5719+
if (fiber === null) {
5720+
// For unkeyed root fragments there's no Fiber. We create a fake one just for
5721+
// error stack handling.
5722+
fiber = createFiberFromElement(element, returnFiber.mode, 0);
5723+
fiber.return = returnFiber;
5724+
}
5725+
5726+
var prevDebugFiber = getCurrentFiber();
5727+
setCurrentFiber(fiber);
5728+
5729+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
5730+
5731+
setCurrentFiber(prevDebugFiber);
5732+
break;
5733+
}
5734+
}
5735+
}
56545736
}
56555737

56565738
function unwrapThenable(thenable) {
@@ -5871,7 +5953,9 @@ function createChildReconciler(shouldTrackSideEffects) {
58715953
var elementType = element.type;
58725954

58735955
if (elementType === REACT_FRAGMENT_TYPE) {
5874-
return updateFragment(returnFiber, current, element.props.children, lanes, element.key, debugInfo);
5956+
var updated = updateFragment(returnFiber, current, element.props.children, lanes, element.key, debugInfo);
5957+
validateFragmentProps(element, updated, returnFiber);
5958+
return updated;
58755959
}
58765960

58775961
if (current !== null) {
@@ -6615,6 +6699,7 @@ function createChildReconciler(shouldTrackSideEffects) {
66156699
existing._debugInfo = debugInfo;
66166700
}
66176701

6702+
validateFragmentProps(element, existing, returnFiber);
66186703
return existing;
66196704
}
66206705
} else {
@@ -6658,6 +6743,7 @@ function createChildReconciler(shouldTrackSideEffects) {
66586743
created._debugInfo = debugInfo;
66596744
}
66606745

6746+
validateFragmentProps(element, created, returnFiber);
66616747
return created;
66626748
} else {
66636749
var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
@@ -6720,6 +6806,7 @@ function createChildReconciler(shouldTrackSideEffects) {
67206806
var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
67216807

67226808
if (isUnkeyedTopLevelFragment) {
6809+
validateFragmentProps(newChild, null, returnFiber);
67236810
newChild = newChild.props.children;
67246811
} // Handle object types
67256812

@@ -23122,10 +23209,22 @@ key, pendingProps, owner, mode, lanes) {
2312223209
}
2312323210

2312423211
var info = '';
23212+
var typeString;
2312523213

2312623214
{
2312723215
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
23128-
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.';
23216+
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.";
23217+
}
23218+
23219+
if (type === null) {
23220+
typeString = 'null';
23221+
} else if (isArray(type)) {
23222+
typeString = 'array';
23223+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
23224+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
23225+
info = ' Did you accidentally export a JSX literal instead of a component?';
23226+
} else {
23227+
typeString = typeof type;
2312923228
}
2313023229

2313123230
var ownerName = owner ? getComponentNameFromOwner(owner) : null;
@@ -23135,7 +23234,7 @@ key, pendingProps, owner, mode, lanes) {
2313523234
}
2313623235
}
2313723236

23138-
throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + ("but got: " + (type == null ? type : typeof type) + "." + info));
23237+
throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + ("but got: " + typeString + "." + info));
2313923238
}
2314023239
}
2314123240
}
@@ -23344,7 +23443,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2334423443
return root;
2334523444
}
2334623445

23347-
var ReactVersion = '19.0.0-rc-47384982';
23446+
var ReactVersion = '19.0.0-rc-c6122275';
2334823447

2334923448
/*
2335023449
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Collapse file

‎compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js‎

Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<6540b866a6ff4178bae5e8496c9c2dc6>>
10+
* @generated SignedSource<<b3af25d61554f4397e525034ff4d9bc6>>
1111
*/
1212

1313
"use strict";
@@ -8774,7 +8774,7 @@ function createFiberFromTypeAndProps(
87748774
}
87758775
throw Error(
87768776
"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
8777-
((null == type ? type : typeof type) + ".")
8777+
((null === type ? "null" : typeof type) + ".")
87788778
);
87798779
}
87808780
key = createFiber(fiberTag, pendingProps, key, mode);
@@ -9300,7 +9300,7 @@ var devToolsConfig$jscomp$inline_1042 = {
93009300
throw Error("TestRenderer does not support findFiberByHostInstance()");
93019301
},
93029302
bundleType: 0,
9303-
version: "19.0.0-rc-59df980e",
9303+
version: "19.0.0-rc-382da410",
93049304
rendererPackageName: "react-test-renderer"
93059305
};
93069306
var internals$jscomp$inline_1229 = {
@@ -9331,7 +9331,7 @@ var internals$jscomp$inline_1229 = {
93319331
scheduleRoot: null,
93329332
setRefreshHandler: null,
93339333
getCurrentFiber: null,
9334-
reconcilerVersion: "19.0.0-rc-59df980e"
9334+
reconcilerVersion: "19.0.0-rc-382da410"
93359335
};
93369336
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
93379337
var hook$jscomp$inline_1230 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Collapse file

‎compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js‎

Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<9640a2643c047b950331599cf3b70c9c>>
10+
* @generated SignedSource<<ebfa53ae43ecaabc34a7bb3185aba21e>>
1111
*/
1212

1313
"use strict";
@@ -9412,7 +9412,7 @@ function createFiberFromTypeAndProps(
94129412
}
94139413
throw Error(
94149414
"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
9415-
((null == type ? type : typeof type) + ".")
9415+
((null === type ? "null" : typeof type) + ".")
94169416
);
94179417
}
94189418
key = createFiber(fiberTag, pendingProps, key, mode);
@@ -9943,7 +9943,7 @@ var devToolsConfig$jscomp$inline_1105 = {
99439943
throw Error("TestRenderer does not support findFiberByHostInstance()");
99449944
},
99459945
bundleType: 0,
9946-
version: "19.0.0-rc-98cdfed4",
9946+
version: "19.0.0-rc-7fcc15f0",
99479947
rendererPackageName: "react-test-renderer"
99489948
};
99499949
(function (internals) {
@@ -9987,7 +9987,7 @@ var devToolsConfig$jscomp$inline_1105 = {
99879987
scheduleRoot: null,
99889988
setRefreshHandler: null,
99899989
getCurrentFiber: null,
9990-
reconcilerVersion: "19.0.0-rc-98cdfed4"
9990+
reconcilerVersion: "19.0.0-rc-7fcc15f0"
99919991
});
99929992
exports._Scheduler = Scheduler;
99939993
exports.act = act;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.