From acd171ae9fd467016b570f507f6ed26f2cb2e044 Mon Sep 17 00:00:00 2001 From: yungsters Date: Tue, 21 May 2024 10:24:17 +0000 Subject: [PATCH] Enable `disableStringRefs` and `enableRefAsProp` for React Native (Meta) (#29177) ## Summary Enables the `disableStringRefs` and `enableRefAsProp` feature flags for React Native (Meta). ## How did you test this change? ``` $ yarn test $ yarn flow fabric ``` DiffTrain build for commit https://github.com/facebook/react/commit/7621466b1b17965032aed24591e9b67fcd926a1b. --- .../react/react/cjs/JSXDEVRuntime-dev.js | 334 +-------------- .../vendor/react/react/cjs/JSXRuntime-dev.js | 334 +-------------- .../vendor/react/react/cjs/JSXRuntime-prod.js | 98 +---- .../react/react/cjs/JSXRuntime-profiling.js | 98 +---- .../vendor/react/react/cjs/React-dev.js | 383 ++---------------- .../vendor/react/react/cjs/React-prod.js | 149 ++----- .../vendor/react/react/cjs/React-profiling.js | 149 ++----- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 65 +-- .../implementations/ReactFabric-prod.fb.js | 92 ++--- .../ReactFabric-profiling.fb.js | 78 ++-- .../ReactNativeRenderer-dev.fb.js | 67 +-- .../ReactNativeRenderer-prod.fb.js | 92 ++--- .../ReactNativeRenderer-profiling.fb.js | 78 ++-- 14 files changed, 271 insertions(+), 1748 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXDEVRuntime-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXDEVRuntime-dev.js index a09ae2d256..b0b531fb7e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXDEVRuntime-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXDEVRuntime-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ 'use strict'; @@ -24,15 +24,15 @@ var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-e // the exports object every time a flag is read. var disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlags.disableStringRefs, - enableFastJSX = dynamicFlags.enableFastJSX, - enableRefAsProp = dynamicFlags.enableRefAsProp; + enableFastJSX = dynamicFlags.enableFastJSX; // The rest of the flags are static for better dead code elimination. var enableDebugTracing = false; var enableRenderableContext = true; var enableScopeAPI = false; var enableLegacyHidden = false; var enableTransitionTracing = false; +var enableRefAsProp = true; +var disableStringRefs = true; // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' @@ -108,7 +108,7 @@ function printWarning(level, format, args) { } } -function getWrappedName$1(outerType, innerType, wrapperName) { +function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { @@ -120,7 +120,7 @@ function getWrappedName$1(outerType, innerType, wrapperName) { } // Keep in sync with react-reconciler/getComponentNameFromFiber -function getContextName$1(type) { +function getContextName(type) { return type.displayName || 'Context'; } @@ -183,17 +183,17 @@ function getComponentNameFromType(type) { var context = type; { - return getContextName$1(context) + '.Provider'; + return getContextName(context) + '.Provider'; } case REACT_CONSUMER_TYPE: { var consumer = type; - return getContextName$1(consumer._context) + '.Consumer'; + return getContextName(consumer._context) + '.Consumer'; } case REACT_FORWARD_REF_TYPE: - return getWrappedName$1(type, type.render, 'ForwardRef'); + return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; @@ -294,15 +294,6 @@ function checkKeyStringCoercion(value) { } } } -function checkPropStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', propName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference'); function isValidElementType(type) { @@ -754,143 +745,6 @@ function describeUnknownElementTypeFrameInDEV(type) { return ''; } -var FunctionComponent = 0; -var ClassComponent = 1; -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - -var HostComponent = 5; -var HostText = 6; -var Fragment = 7; -var Mode = 8; -var ContextConsumer = 9; -var ContextProvider = 10; -var ForwardRef = 11; -var Profiler = 12; -var SuspenseComponent = 13; -var MemoComponent = 14; -var SimpleMemoComponent = 15; -var LazyComponent = 16; -var IncompleteClassComponent = 17; -var DehydratedFragment = 18; -var SuspenseListComponent = 19; -var ScopeComponent = 21; -var OffscreenComponent = 22; -var CacheComponent = 24; -var TracingMarkerComponent = 25; -var HostHoistable = 26; -var HostSingleton = 27; -var IncompleteFunctionComponent = 28; - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} // Keep in sync with shared/getComponentNameFromType - - -function getContextName(type) { - return type.displayName || 'Context'; -} -function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, - type = fiber.type; - - switch (tag) { - case CacheComponent: - return 'Cache'; - - case ContextConsumer: - { - var consumer = type; - return getContextName(consumer._context) + '.Consumer'; - } - - case ContextProvider: - { - var _context = type; - return getContextName(_context) + '.Provider'; - } - - case DehydratedFragment: - return 'DehydratedFragment'; - - case ForwardRef: - return getWrappedName(type, type.render, 'ForwardRef'); - - case Fragment: - return 'Fragment'; - - case HostHoistable: - case HostSingleton: - case HostComponent: - // Host component type is the display name (e.g. "div", "View") - return type; - - case HostPortal: - return 'Portal'; - - case HostRoot: - return 'Root'; - - case HostText: - return 'Text'; - - case LazyComponent: - // Name comes from the type in this case; we don't have a tag. - return getComponentNameFromType(type); - - case Mode: - if (type === REACT_STRICT_MODE_TYPE) { - // Don't be less specific than shared/getComponentNameFromType - return 'StrictMode'; - } - - return 'Mode'; - - case OffscreenComponent: - return 'Offscreen'; - - case Profiler: - return 'Profiler'; - - case ScopeComponent: - return 'Scope'; - - case SuspenseComponent: - return 'Suspense'; - - case SuspenseListComponent: - return 'SuspenseList'; - - case TracingMarkerComponent: - return 'TracingMarker'; - // The display name for these tags come from the user-provided type: - - case IncompleteClassComponent: - case IncompleteFunctionComponent: - - // Fallthrough - - case ClassComponent: - case FunctionComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - break; - - } - - return null; -} - var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); function getOwner() { @@ -906,12 +760,9 @@ function getOwner() { } var specialPropKeyWarningShown; -var specialPropRefWarningShown; -var didWarnAboutStringRefs; var didWarnAboutElementRef; { - didWarnAboutStringRefs = {}; didWarnAboutElementRef = {}; } @@ -946,22 +797,6 @@ function hasValidKey(config) { return config.key !== undefined; } -function warnIfStringRefCannotBeAutoConverted(config, self) { - { - var owner; - - if (!disableStringRefs && typeof config.ref === 'string' && (owner = getOwner()) && self && owner.stateNode !== self) { - var componentName = getComponentNameFromType(owner.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref', getComponentNameFromType(owner.type), config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } -} - function defineKeyPropWarningGetter(props, displayName) { { var warnAboutAccessingKey = function () { @@ -980,26 +815,6 @@ function defineKeyPropWarningGetter(props, displayName) { } } -function defineRefPropWarningGetter(props, displayName) { - if (!enableRefAsProp) { - { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://react.dev/link/special-props)', displayName); - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); - } - } -} - function elementRefGetterWithDeprecationWarning() { { var componentName = getComponentNameFromType(this.type); @@ -1041,7 +856,7 @@ function elementRefGetterWithDeprecationWarning() { function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) { var ref; - if (enableRefAsProp) { + { // When enableRefAsProp is on, ignore whatever was passed as the ref // argument and treat `props.ref` as the source of truth. The only thing we // use this for is `element.ref`, which will log a deprecation warning on @@ -1051,13 +866,11 @@ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, d // backwards compatibility. ref = refProp !== undefined ? refProp : null; - } else { - ref = _ref; } var element; - if (enableRefAsProp) { + { // In dev, make `ref` a non-enumerable property with a warning. It's non- // enumerable so that test matchers and serializers don't access it and // trigger the warning. @@ -1098,20 +911,6 @@ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, d value: null }); } - } else { - // In prod, `ref` is a regular property. It will be removed in a - // future release. - element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; } { @@ -1250,19 +1049,7 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) { key = '' + config.key; } - if (hasValidRef(config)) { - if (!enableRefAsProp) { - ref = config.ref; - - if (!disableStringRefs) { - ref = coerceStringRef(ref, getOwner(), type); - } - } - - if (!disableStringRefs) { - warnIfStringRefCannotBeAutoConverted(config, self); - } - } + if (hasValidRef(config)) ; var props; @@ -1285,10 +1072,8 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) { for (var propName in config) { // Skip over reserved prop names - if (propName !== 'key' && (enableRefAsProp || propName !== 'ref')) { - if (enableRefAsProp && !disableStringRefs && propName === 'ref') { - props.ref = coerceStringRef(config[propName], getOwner(), type); - } else { + if (propName !== 'key' && (enableRefAsProp )) { + { props[propName] = config[propName]; } } @@ -1308,16 +1093,12 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) { } } - if (key || !enableRefAsProp && ref) { + if (key || !enableRefAsProp ) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } - - if (!enableRefAsProp && ref) { - defineRefPropWarningGetter(props, displayName); - } } var element = ReactElement(type, key, ref, self, source, getOwner(), props); @@ -1512,94 +1293,9 @@ function validateFragmentProps(fragment) { break; } } - - if (!enableRefAsProp && fragment.ref !== null) { - setCurrentlyValidatingElement(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement(null); - } } } -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) { - return mixedRef; - } - - var stringRef; - - if (typeof mixedRef === 'string') { - stringRef = mixedRef; - } else { - if (typeof mixedRef === 'number' || typeof mixedRef === 'boolean') { - { - checkPropStringCoercion(mixedRef, 'ref'); - } - - stringRef = '' + mixedRef; - } else { - return mixedRef; - } - } - - var callback = stringRefAsCallbackRef.bind(null, stringRef, type, owner); // This is used to check whether two callback refs conceptually represent - // the same string ref, and can therefore be reused by the reconciler. Needed - // for backwards compatibility with old Meta code that relies on string refs - // not being reattached on every render. - - callback.__stringRef = stringRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} - -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (disableStringRefs) { - return; - } - - if (!owner) { - throw new Error("Element ref was specified as a string (" + stringRef + ") but no owner was set. This could happen for one of" + ' the following reasons:\n' + '1. You may be adding a ref to a function component\n' + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + '3. You have multiple copies of React loaded\n' + 'See https://react.dev/link/refs-must-have-owner for more information.'); - } - - if (owner.tag !== ClassComponent) { - throw new Error('Function components cannot have string refs. ' + 'We recommend using useRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref'); - } - - { - if ( // Will already warn with "Function components cannot be given refs" - !(typeof type === 'function' && !isReactClass(type))) { - var componentName = getComponentNameFromFiber(owner) || 'Component'; - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref', componentName, stringRef); - - didWarnAboutStringRefs[componentName] = true; - } - } - } - - var inst = owner.stateNode; - - if (!inst) { - throw new Error("Missing owner for string ref " + stringRef + ". This error is likely caused by a " + 'bug in React. Please file an issue.'); - } - - var refs = inst.refs; - - if (value === null) { - delete refs[stringRef]; - } else { - refs[stringRef] = value; - } -} - -function isReactClass(type) { - return type.prototype && type.prototype.isReactComponent; -} - var jsxDEV = jsxDEV$1 ; exports.Fragment = REACT_FRAGMENT_TYPE; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-dev.js index 26731c14aa..b2f0024c27 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<71139a2081b9ee803b48b333bc213727>> + * @generated SignedSource<<4c3bee042278a4a49d386c57d4f82f3b>> */ 'use strict'; @@ -24,15 +24,15 @@ var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-e // the exports object every time a flag is read. var disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlags.disableStringRefs, - enableFastJSX = dynamicFlags.enableFastJSX, - enableRefAsProp = dynamicFlags.enableRefAsProp; + enableFastJSX = dynamicFlags.enableFastJSX; // The rest of the flags are static for better dead code elimination. var enableDebugTracing = false; var enableRenderableContext = true; var enableScopeAPI = false; var enableLegacyHidden = false; var enableTransitionTracing = false; +var enableRefAsProp = true; +var disableStringRefs = true; // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' @@ -108,7 +108,7 @@ function printWarning(level, format, args) { } } -function getWrappedName$1(outerType, innerType, wrapperName) { +function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { @@ -120,7 +120,7 @@ function getWrappedName$1(outerType, innerType, wrapperName) { } // Keep in sync with react-reconciler/getComponentNameFromFiber -function getContextName$1(type) { +function getContextName(type) { return type.displayName || 'Context'; } @@ -183,17 +183,17 @@ function getComponentNameFromType(type) { var context = type; { - return getContextName$1(context) + '.Provider'; + return getContextName(context) + '.Provider'; } case REACT_CONSUMER_TYPE: { var consumer = type; - return getContextName$1(consumer._context) + '.Consumer'; + return getContextName(consumer._context) + '.Consumer'; } case REACT_FORWARD_REF_TYPE: - return getWrappedName$1(type, type.render, 'ForwardRef'); + return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; @@ -294,15 +294,6 @@ function checkKeyStringCoercion(value) { } } } -function checkPropStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', propName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference'); function isValidElementType(type) { @@ -754,143 +745,6 @@ function describeUnknownElementTypeFrameInDEV(type) { return ''; } -var FunctionComponent = 0; -var ClassComponent = 1; -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - -var HostComponent = 5; -var HostText = 6; -var Fragment = 7; -var Mode = 8; -var ContextConsumer = 9; -var ContextProvider = 10; -var ForwardRef = 11; -var Profiler = 12; -var SuspenseComponent = 13; -var MemoComponent = 14; -var SimpleMemoComponent = 15; -var LazyComponent = 16; -var IncompleteClassComponent = 17; -var DehydratedFragment = 18; -var SuspenseListComponent = 19; -var ScopeComponent = 21; -var OffscreenComponent = 22; -var CacheComponent = 24; -var TracingMarkerComponent = 25; -var HostHoistable = 26; -var HostSingleton = 27; -var IncompleteFunctionComponent = 28; - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} // Keep in sync with shared/getComponentNameFromType - - -function getContextName(type) { - return type.displayName || 'Context'; -} -function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, - type = fiber.type; - - switch (tag) { - case CacheComponent: - return 'Cache'; - - case ContextConsumer: - { - var consumer = type; - return getContextName(consumer._context) + '.Consumer'; - } - - case ContextProvider: - { - var _context = type; - return getContextName(_context) + '.Provider'; - } - - case DehydratedFragment: - return 'DehydratedFragment'; - - case ForwardRef: - return getWrappedName(type, type.render, 'ForwardRef'); - - case Fragment: - return 'Fragment'; - - case HostHoistable: - case HostSingleton: - case HostComponent: - // Host component type is the display name (e.g. "div", "View") - return type; - - case HostPortal: - return 'Portal'; - - case HostRoot: - return 'Root'; - - case HostText: - return 'Text'; - - case LazyComponent: - // Name comes from the type in this case; we don't have a tag. - return getComponentNameFromType(type); - - case Mode: - if (type === REACT_STRICT_MODE_TYPE) { - // Don't be less specific than shared/getComponentNameFromType - return 'StrictMode'; - } - - return 'Mode'; - - case OffscreenComponent: - return 'Offscreen'; - - case Profiler: - return 'Profiler'; - - case ScopeComponent: - return 'Scope'; - - case SuspenseComponent: - return 'Suspense'; - - case SuspenseListComponent: - return 'SuspenseList'; - - case TracingMarkerComponent: - return 'TracingMarker'; - // The display name for these tags come from the user-provided type: - - case IncompleteClassComponent: - case IncompleteFunctionComponent: - - // Fallthrough - - case ClassComponent: - case FunctionComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - break; - - } - - return null; -} - var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); function getOwner() { @@ -906,12 +760,9 @@ function getOwner() { } var specialPropKeyWarningShown; -var specialPropRefWarningShown; -var didWarnAboutStringRefs; var didWarnAboutElementRef; { - didWarnAboutStringRefs = {}; didWarnAboutElementRef = {}; } @@ -946,22 +797,6 @@ function hasValidKey(config) { return config.key !== undefined; } -function warnIfStringRefCannotBeAutoConverted(config, self) { - { - var owner; - - if (!disableStringRefs && typeof config.ref === 'string' && (owner = getOwner()) && self && owner.stateNode !== self) { - var componentName = getComponentNameFromType(owner.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref', getComponentNameFromType(owner.type), config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } -} - function defineKeyPropWarningGetter(props, displayName) { { var warnAboutAccessingKey = function () { @@ -980,26 +815,6 @@ function defineKeyPropWarningGetter(props, displayName) { } } -function defineRefPropWarningGetter(props, displayName) { - if (!enableRefAsProp) { - { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://react.dev/link/special-props)', displayName); - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); - } - } -} - function elementRefGetterWithDeprecationWarning() { { var componentName = getComponentNameFromType(this.type); @@ -1041,7 +856,7 @@ function elementRefGetterWithDeprecationWarning() { function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) { var ref; - if (enableRefAsProp) { + { // When enableRefAsProp is on, ignore whatever was passed as the ref // argument and treat `props.ref` as the source of truth. The only thing we // use this for is `element.ref`, which will log a deprecation warning on @@ -1051,13 +866,11 @@ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, d // backwards compatibility. ref = refProp !== undefined ? refProp : null; - } else { - ref = _ref; } var element; - if (enableRefAsProp) { + { // In dev, make `ref` a non-enumerable property with a warning. It's non- // enumerable so that test matchers and serializers don't access it and // trigger the warning. @@ -1098,20 +911,6 @@ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, d value: null }); } - } else { - // In prod, `ref` is a regular property. It will be removed in a - // future release. - element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; } { @@ -1274,19 +1073,7 @@ function jsxDEV(type, config, maybeKey, isStaticChildren, source, self) { key = '' + config.key; } - if (hasValidRef(config)) { - if (!enableRefAsProp) { - ref = config.ref; - - if (!disableStringRefs) { - ref = coerceStringRef(ref, getOwner(), type); - } - } - - if (!disableStringRefs) { - warnIfStringRefCannotBeAutoConverted(config, self); - } - } + if (hasValidRef(config)) ; var props; @@ -1309,10 +1096,8 @@ function jsxDEV(type, config, maybeKey, isStaticChildren, source, self) { for (var propName in config) { // Skip over reserved prop names - if (propName !== 'key' && (enableRefAsProp || propName !== 'ref')) { - if (enableRefAsProp && !disableStringRefs && propName === 'ref') { - props.ref = coerceStringRef(config[propName], getOwner(), type); - } else { + if (propName !== 'key' && (enableRefAsProp )) { + { props[propName] = config[propName]; } } @@ -1332,16 +1117,12 @@ function jsxDEV(type, config, maybeKey, isStaticChildren, source, self) { } } - if (key || !enableRefAsProp && ref) { + if (key || !enableRefAsProp ) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } - - if (!enableRefAsProp && ref) { - defineRefPropWarningGetter(props, displayName); - } } var element = ReactElement(type, key, ref, self, source, getOwner(), props); @@ -1536,94 +1317,9 @@ function validateFragmentProps(fragment) { break; } } - - if (!enableRefAsProp && fragment.ref !== null) { - setCurrentlyValidatingElement(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement(null); - } } } -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) { - return mixedRef; - } - - var stringRef; - - if (typeof mixedRef === 'string') { - stringRef = mixedRef; - } else { - if (typeof mixedRef === 'number' || typeof mixedRef === 'boolean') { - { - checkPropStringCoercion(mixedRef, 'ref'); - } - - stringRef = '' + mixedRef; - } else { - return mixedRef; - } - } - - var callback = stringRefAsCallbackRef.bind(null, stringRef, type, owner); // This is used to check whether two callback refs conceptually represent - // the same string ref, and can therefore be reused by the reconciler. Needed - // for backwards compatibility with old Meta code that relies on string refs - // not being reattached on every render. - - callback.__stringRef = stringRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} - -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (disableStringRefs) { - return; - } - - if (!owner) { - throw new Error("Element ref was specified as a string (" + stringRef + ") but no owner was set. This could happen for one of" + ' the following reasons:\n' + '1. You may be adding a ref to a function component\n' + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + '3. You have multiple copies of React loaded\n' + 'See https://react.dev/link/refs-must-have-owner for more information.'); - } - - if (owner.tag !== ClassComponent) { - throw new Error('Function components cannot have string refs. ' + 'We recommend using useRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref'); - } - - { - if ( // Will already warn with "Function components cannot be given refs" - !(typeof type === 'function' && !isReactClass(type))) { - var componentName = getComponentNameFromFiber(owner) || 'Component'; - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref', componentName, stringRef); - - didWarnAboutStringRefs[componentName] = true; - } - } - } - - var inst = owner.stateNode; - - if (!inst) { - throw new Error("Missing owner for string ref " + stringRef + ". This error is likely caused by a " + 'bug in React. Please file an issue.'); - } - - var refs = inst.refs; - - if (value === null) { - delete refs[stringRef]; - } else { - refs[stringRef] = value; - } -} - -function isReactClass(type) { - return type.prototype && type.prototype.isReactComponent; -} - var jsx = jsxProdSignatureRunningInDevWithDynamicChildren ; // we may want to special case jsxs internally to take advantage of static children. // for now we can ship identical prod functions diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-prod.js index a7ae88d361..7c0ba96f6e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-prod.js @@ -7,55 +7,22 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<5ca9eeb178dcdb38a2d5649f74dbc0b1>> + * @generated SignedSource<<3c36d2bec2ca67d95aca9dd486109ea6>> */ "use strict"; var dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"), - React = require("react"), disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableFastJSX = dynamicFlagsUntyped.enableFastJSX, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); -} -var ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; -function getOwner() { - if (!disableStringRefs) { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - return null; -} -var enableFastJSXWithStringRefs = enableFastJSX && enableRefAsProp, - enableFastJSXWithoutStringRefs = - enableFastJSXWithStringRefs && disableStringRefs; + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + enableFastJSXWithStringRefs = enableFastJSX && !0, + enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !0; function jsxProd(type, config, maybeKey) { - var key = null, - ref = null; + var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - void 0 === config.ref || - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || (ref = coerceStringRef(ref, getOwner(), type))); if ( (!enableFastJSXWithoutStringRefs && (!enableFastJSXWithStringRefs || "ref" in config)) || @@ -63,11 +30,7 @@ function jsxProd(type, config, maybeKey) { ) { maybeKey = {}; for (var propName in config) - "key" === propName || - (!enableRefAsProp && "ref" === propName) || - (enableRefAsProp && !disableStringRefs && "ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + "key" !== propName && (maybeKey[propName] = config[propName]); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -75,47 +38,14 @@ function jsxProd(type, config, maybeKey) { void 0 === maybeKey[propName$0] && (maybeKey[propName$0] = config[propName$0]); } - propName$0 = getOwner(); - enableRefAsProp && - ((ref = maybeKey.ref), (ref = void 0 !== ref ? ref : null)); - return disableStringRefs - ? { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: ref, - props: maybeKey - } - : { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: ref, - props: maybeKey, - _owner: propName$0 - }; -} -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) return mixedRef; - if ("string" !== typeof mixedRef) - if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) - mixedRef = "" + mixedRef; - else return mixedRef; - var callback = stringRefAsCallbackRef.bind(null, mixedRef, type, owner); - callback.__stringRef = mixedRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!disableStringRefs) { - if (!owner) throw Error(formatProdErrorMessage(290, stringRef)); - if (1 !== owner.tag) throw Error(formatProdErrorMessage(309)); - type = owner.stateNode; - if (!type) throw Error(formatProdErrorMessage(147, stringRef)); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); - } + propName$0 = maybeKey.ref; + return { + $$typeof: REACT_LEGACY_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== propName$0 ? propName$0 : null, + props: maybeKey + }; } exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = jsxProd; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-profiling.js index a7ae88d361..7c0ba96f6e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/JSXRuntime-profiling.js @@ -7,55 +7,22 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<5ca9eeb178dcdb38a2d5649f74dbc0b1>> + * @generated SignedSource<<3c36d2bec2ca67d95aca9dd486109ea6>> */ "use strict"; var dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"), - React = require("react"), disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableFastJSX = dynamicFlagsUntyped.enableFastJSX, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); -} -var ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; -function getOwner() { - if (!disableStringRefs) { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - return null; -} -var enableFastJSXWithStringRefs = enableFastJSX && enableRefAsProp, - enableFastJSXWithoutStringRefs = - enableFastJSXWithStringRefs && disableStringRefs; + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + enableFastJSXWithStringRefs = enableFastJSX && !0, + enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !0; function jsxProd(type, config, maybeKey) { - var key = null, - ref = null; + var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - void 0 === config.ref || - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || (ref = coerceStringRef(ref, getOwner(), type))); if ( (!enableFastJSXWithoutStringRefs && (!enableFastJSXWithStringRefs || "ref" in config)) || @@ -63,11 +30,7 @@ function jsxProd(type, config, maybeKey) { ) { maybeKey = {}; for (var propName in config) - "key" === propName || - (!enableRefAsProp && "ref" === propName) || - (enableRefAsProp && !disableStringRefs && "ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + "key" !== propName && (maybeKey[propName] = config[propName]); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -75,47 +38,14 @@ function jsxProd(type, config, maybeKey) { void 0 === maybeKey[propName$0] && (maybeKey[propName$0] = config[propName$0]); } - propName$0 = getOwner(); - enableRefAsProp && - ((ref = maybeKey.ref), (ref = void 0 !== ref ? ref : null)); - return disableStringRefs - ? { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: ref, - props: maybeKey - } - : { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: ref, - props: maybeKey, - _owner: propName$0 - }; -} -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) return mixedRef; - if ("string" !== typeof mixedRef) - if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) - mixedRef = "" + mixedRef; - else return mixedRef; - var callback = stringRefAsCallbackRef.bind(null, mixedRef, type, owner); - callback.__stringRef = mixedRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!disableStringRefs) { - if (!owner) throw Error(formatProdErrorMessage(290, stringRef)); - if (1 !== owner.tag) throw Error(formatProdErrorMessage(309)); - type = owner.stateNode; - if (!type) throw Error(formatProdErrorMessage(147, stringRef)); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); - } + propName$0 = maybeKey.ref; + return { + $$typeof: REACT_LEGACY_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== propName$0 ? propName$0 : null, + props: maybeKey + }; } exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = jsxProd; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js index 2690b2499f..4e734383ec 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<8bb33a6a3191b73ecb105d7607dc2eac>> + * @generated SignedSource<<4bef08404d3aea55caa1230f32a63bc4>> */ 'use strict'; @@ -24,22 +24,22 @@ if ( } var dynamicFlagsUntyped = require('ReactNativeInternalFeatureFlags'); -var ReactVersion = '19.0.0-rc-c24078b0'; +var ReactVersion = '19.0.0-rc-b0b64d87'; // Re-export dynamic flags from the internal module. var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-exporting to avoid a dynamic look-up on // the exports object every time a flag is read. var disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlags.disableStringRefs, - enableFastJSX = dynamicFlags.enableFastJSX, - enableRefAsProp = dynamicFlags.enableRefAsProp; + enableFastJSX = dynamicFlags.enableFastJSX; // The rest of the flags are static for better dead code elimination. var enableDebugTracing = false; var enableRenderableContext = true; var enableScopeAPI = false; var enableLegacyHidden = false; var enableTransitionTracing = false; +var enableRefAsProp = true; +var disableStringRefs = true; var disableLegacyMode = false; // When adding new symbols to this file, @@ -472,17 +472,8 @@ function checkKeyStringCoercion(value) { } } } -function checkPropStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', propName, typeName(value)); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} - -function getWrappedName$1(outerType, innerType, wrapperName) { +function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { @@ -494,7 +485,7 @@ function getWrappedName$1(outerType, innerType, wrapperName) { } // Keep in sync with react-reconciler/getComponentNameFromFiber -function getContextName$1(type) { +function getContextName(type) { return type.displayName || 'Context'; } @@ -557,17 +548,17 @@ function getComponentNameFromType(type) { var context = type; { - return getContextName$1(context) + '.Provider'; + return getContextName(context) + '.Provider'; } case REACT_CONSUMER_TYPE: { var consumer = type; - return getContextName$1(consumer._context) + '.Consumer'; + return getContextName(consumer._context) + '.Consumer'; } case REACT_FORWARD_REF_TYPE: - return getWrappedName$1(type, type.render, 'ForwardRef'); + return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; @@ -1043,143 +1034,6 @@ function describeUnknownElementTypeFrameInDEV(type) { return ''; } -var FunctionComponent = 0; -var ClassComponent = 1; -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - -var HostComponent = 5; -var HostText = 6; -var Fragment = 7; -var Mode = 8; -var ContextConsumer = 9; -var ContextProvider = 10; -var ForwardRef = 11; -var Profiler = 12; -var SuspenseComponent = 13; -var MemoComponent = 14; -var SimpleMemoComponent = 15; -var LazyComponent = 16; -var IncompleteClassComponent = 17; -var DehydratedFragment = 18; -var SuspenseListComponent = 19; -var ScopeComponent = 21; -var OffscreenComponent = 22; -var CacheComponent = 24; -var TracingMarkerComponent = 25; -var HostHoistable = 26; -var HostSingleton = 27; -var IncompleteFunctionComponent = 28; - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} // Keep in sync with shared/getComponentNameFromType - - -function getContextName(type) { - return type.displayName || 'Context'; -} -function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, - type = fiber.type; - - switch (tag) { - case CacheComponent: - return 'Cache'; - - case ContextConsumer: - { - var consumer = type; - return getContextName(consumer._context) + '.Consumer'; - } - - case ContextProvider: - { - var _context = type; - return getContextName(_context) + '.Provider'; - } - - case DehydratedFragment: - return 'DehydratedFragment'; - - case ForwardRef: - return getWrappedName(type, type.render, 'ForwardRef'); - - case Fragment: - return 'Fragment'; - - case HostHoistable: - case HostSingleton: - case HostComponent: - // Host component type is the display name (e.g. "div", "View") - return type; - - case HostPortal: - return 'Portal'; - - case HostRoot: - return 'Root'; - - case HostText: - return 'Text'; - - case LazyComponent: - // Name comes from the type in this case; we don't have a tag. - return getComponentNameFromType(type); - - case Mode: - if (type === REACT_STRICT_MODE_TYPE) { - // Don't be less specific than shared/getComponentNameFromType - return 'StrictMode'; - } - - return 'Mode'; - - case OffscreenComponent: - return 'Offscreen'; - - case Profiler: - return 'Profiler'; - - case ScopeComponent: - return 'Scope'; - - case SuspenseComponent: - return 'Suspense'; - - case SuspenseListComponent: - return 'SuspenseList'; - - case TracingMarkerComponent: - return 'TracingMarker'; - // The display name for these tags come from the user-provided type: - - case IncompleteClassComponent: - case IncompleteFunctionComponent: - - // Fallthrough - - case ClassComponent: - case FunctionComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - break; - - } - - return null; -} - var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); function getOwner() { @@ -1195,13 +1049,10 @@ function getOwner() { } var specialPropKeyWarningShown; -var specialPropRefWarningShown; -var didWarnAboutStringRefs; var didWarnAboutElementRef; var didWarnAboutOldJSXRuntime; { - didWarnAboutStringRefs = {}; didWarnAboutElementRef = {}; } @@ -1236,22 +1087,6 @@ function hasValidKey(config) { return config.key !== undefined; } -function warnIfStringRefCannotBeAutoConverted(config, self) { - { - var owner; - - if (!disableStringRefs && typeof config.ref === 'string' && (owner = getOwner()) && self && owner.stateNode !== self) { - var componentName = getComponentNameFromType(owner.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref', getComponentNameFromType(owner.type), config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } -} - function defineKeyPropWarningGetter(props, displayName) { { var warnAboutAccessingKey = function () { @@ -1270,26 +1105,6 @@ function defineKeyPropWarningGetter(props, displayName) { } } -function defineRefPropWarningGetter(props, displayName) { - if (!enableRefAsProp) { - { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://react.dev/link/special-props)', displayName); - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); - } - } -} - function elementRefGetterWithDeprecationWarning() { { var componentName = getComponentNameFromType(this.type); @@ -1331,7 +1146,7 @@ function elementRefGetterWithDeprecationWarning() { function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) { var ref; - if (enableRefAsProp) { + { // When enableRefAsProp is on, ignore whatever was passed as the ref // argument and treat `props.ref` as the source of truth. The only thing we // use this for is `element.ref`, which will log a deprecation warning on @@ -1341,13 +1156,11 @@ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, d // backwards compatibility. ref = refProp !== undefined ? refProp : null; - } else { - ref = _ref; } var element; - if (enableRefAsProp) { + { // In dev, make `ref` a non-enumerable property with a warning. It's non- // enumerable so that test matchers and serializers don't access it and // trigger the warning. @@ -1388,20 +1201,6 @@ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, d value: null }); } - } else { - // In prod, `ref` is a regular property. It will be removed in a - // future release. - element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; } { @@ -1564,19 +1363,7 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) { key = '' + config.key; } - if (hasValidRef(config)) { - if (!enableRefAsProp) { - ref = config.ref; - - if (!disableStringRefs) { - ref = coerceStringRef(ref, getOwner(), type); - } - } - - if (!disableStringRefs) { - warnIfStringRefCannotBeAutoConverted(config, self); - } - } + if (hasValidRef(config)) ; var props; @@ -1599,10 +1386,8 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) { for (var propName in config) { // Skip over reserved prop names - if (propName !== 'key' && (enableRefAsProp || propName !== 'ref')) { - if (enableRefAsProp && !disableStringRefs && propName === 'ref') { - props.ref = coerceStringRef(config[propName], getOwner(), type); - } else { + if (propName !== 'key' && (enableRefAsProp )) { + { props[propName] = config[propName]; } } @@ -1622,16 +1407,12 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) { } } - if (key || !enableRefAsProp && ref) { + if (key || !enableRefAsProp ) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } - - if (!enableRefAsProp && ref) { - defineRefPropWarningGetter(props, displayName); - } } var element = ReactElement(type, key, ref, self, source, getOwner(), props); @@ -1709,19 +1490,7 @@ function createElement(type, config, children) { } } - if (hasValidRef(config)) { - if (!enableRefAsProp) { - ref = config.ref; - - if (!disableStringRefs) { - ref = coerceStringRef(ref, getOwner(), type); - } - } - - if (!disableStringRefs) { - warnIfStringRefCannotBeAutoConverted(config, config.__self); - } - } + if (hasValidRef(config)) ; if (hasValidKey(config)) { { @@ -1734,14 +1503,12 @@ function createElement(type, config, children) { for (propName in config) { if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names - propName !== 'key' && (enableRefAsProp || propName !== 'ref') && // Even though we don't use these anymore in the runtime, we don't want + propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want // them to appear as props, so in createElement we filter them out. // We don't have to do this in the jsx() runtime because the jsx() // transform never passed these as props; it used separate arguments. propName !== '__self' && propName !== '__source') { - if (enableRefAsProp && !disableStringRefs && propName === 'ref') { - props.ref = coerceStringRef(config[propName], getOwner(), type); - } else { + { props[propName] = config[propName]; } } @@ -1782,16 +1549,12 @@ function createElement(type, config, children) { } { - if (key || !enableRefAsProp && ref) { + if (key || !enableRefAsProp ) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } - - if (!enableRefAsProp && ref) { - defineRefPropWarningGetter(props, displayName); - } } } @@ -1806,7 +1569,7 @@ function createElement(type, config, children) { function cloneAndReplaceKey(oldElement, newKey) { return ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only // exists to avoid the `ref` access warning. - enableRefAsProp ? null : oldElement.ref, undefined, undefined, oldElement._owner, oldElement.props); + null , undefined, undefined, oldElement._owner, oldElement.props); } /** * Clone and return a new ReactElement using element as the starting point. @@ -1823,22 +1586,13 @@ function cloneElement(element, config, children) { var props = assign({}, element.props); // Reserved names are extracted var key = element.key; - var ref = enableRefAsProp ? null : element.ref; // Owner will be preserved, unless ref is overridden + var ref = null ; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (hasValidRef(config)) { owner = getOwner() ; - - if (!enableRefAsProp) { - // Silently steal the ref from the parent. - ref = config.ref; - - if (!disableStringRefs) { - ref = coerceStringRef(ref, owner, element.type); - } - } } if (hasValidKey(config)) { @@ -1858,7 +1612,7 @@ function cloneElement(element, config, children) { for (propName in config) { if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names - propName !== 'key' && (enableRefAsProp || propName !== 'ref') && // ...and maybe these, too, though we currently rely on them for + propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for // warnings and debug information in dev. Need to decide if we're OK // with dropping them. In the jsx() runtime it's not an issue because // the data gets passed as separate arguments instead of props, but @@ -1867,14 +1621,12 @@ function cloneElement(element, config, children) { propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as // if the property were missing. This is mostly for // backwards compatibility. - !(enableRefAsProp && propName === 'ref' && config.ref === undefined)) { + !(propName === 'ref' && config.ref === undefined)) { if (!disableDefaultPropsExceptForClasses && config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { - if (enableRefAsProp && !disableStringRefs && propName === 'ref') { - props.ref = coerceStringRef(config[propName], owner, element.type); - } else { + { props[propName] = config[propName]; } } @@ -2089,94 +1841,9 @@ function validateFragmentProps(fragment) { break; } } - - if (!enableRefAsProp && fragment.ref !== null) { - setCurrentlyValidatingElement(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement(null); - } } } -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) { - return mixedRef; - } - - var stringRef; - - if (typeof mixedRef === 'string') { - stringRef = mixedRef; - } else { - if (typeof mixedRef === 'number' || typeof mixedRef === 'boolean') { - { - checkPropStringCoercion(mixedRef, 'ref'); - } - - stringRef = '' + mixedRef; - } else { - return mixedRef; - } - } - - var callback = stringRefAsCallbackRef.bind(null, stringRef, type, owner); // This is used to check whether two callback refs conceptually represent - // the same string ref, and can therefore be reused by the reconciler. Needed - // for backwards compatibility with old Meta code that relies on string refs - // not being reattached on every render. - - callback.__stringRef = stringRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} - -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (disableStringRefs) { - return; - } - - if (!owner) { - throw new Error("Element ref was specified as a string (" + stringRef + ") but no owner was set. This could happen for one of" + ' the following reasons:\n' + '1. You may be adding a ref to a function component\n' + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + '3. You have multiple copies of React loaded\n' + 'See https://react.dev/link/refs-must-have-owner for more information.'); - } - - if (owner.tag !== ClassComponent) { - throw new Error('Function components cannot have string refs. ' + 'We recommend using useRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref'); - } - - { - if ( // Will already warn with "Function components cannot be given refs" - !(typeof type === 'function' && !isReactClass(type))) { - var componentName = getComponentNameFromFiber(owner) || 'Component'; - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://react.dev/link/strict-mode-string-ref', componentName, stringRef); - - didWarnAboutStringRefs[componentName] = true; - } - } - } - - var inst = owner.stateNode; - - if (!inst) { - throw new Error("Missing owner for string ref " + stringRef + ". This error is likely caused by a " + 'bug in React. Please file an issue.'); - } - - var refs = inst.refs; - - if (value === null) { - delete refs[stringRef]; - } else { - refs[stringRef] = value; - } -} - -function isReactClass(type) { - return type.prototype && type.prototype.isReactComponent; -} - var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js index 35873cf756..bdcd3bad78 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js @@ -7,16 +7,14 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<21b16061fb9d91a43f1670d4349550c9>> + * @generated SignedSource<> */ "use strict"; var dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableFastJSX = dynamicFlagsUntyped.enableFastJSX, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -87,46 +85,23 @@ assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = !0; var isArrayImpl = Array.isArray, ReactSharedInternals = { H: null, A: null, T: null }, - hasOwnProperty = Object.prototype.hasOwnProperty; -function getOwner() { - if (!disableStringRefs) { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - return null; -} -var enableFastJSXWithStringRefs = enableFastJSX && enableRefAsProp, - enableFastJSXWithoutStringRefs = - enableFastJSXWithStringRefs && disableStringRefs; + hasOwnProperty = Object.prototype.hasOwnProperty, + enableFastJSXWithStringRefs = enableFastJSX && !0, + enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !0; function ReactElement(type, key, _ref, self, source, owner, props) { - enableRefAsProp && - ((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null)); - return disableStringRefs - ? { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: _ref, - props: props - } - : { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: _ref, - props: props, - _owner: owner - }; + _ref = props.ref; + return { + $$typeof: REACT_LEGACY_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== _ref ? _ref : null, + props: props + }; } function jsxProd(type, config, maybeKey) { - var key = null, - ref = null; + var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - void 0 === config.ref || - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || (ref = coerceStringRef(ref, getOwner(), type))); if ( (!enableFastJSXWithoutStringRefs && (!enableFastJSXWithStringRefs || "ref" in config)) || @@ -134,11 +109,7 @@ function jsxProd(type, config, maybeKey) { ) { maybeKey = {}; for (var propName in config) - "key" === propName || - (!enableRefAsProp && "ref" === propName) || - (enableRefAsProp && !disableStringRefs && "ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + "key" !== propName && (maybeKey[propName] = config[propName]); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -146,16 +117,16 @@ function jsxProd(type, config, maybeKey) { void 0 === maybeKey[propName$0] && (maybeKey[propName$0] = config[propName$0]); } - return ReactElement(type, key, ref, void 0, void 0, getOwner(), maybeKey); + return ReactElement(type, key, null, void 0, void 0, null, maybeKey); } function cloneAndReplaceKey(oldElement, newKey) { return ReactElement( oldElement.type, newKey, - enableRefAsProp ? null : oldElement.ref, + null, + void 0, void 0, void 0, - disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -166,41 +137,6 @@ function isValidElement(object) { object.$$typeof === REACT_LEGACY_ELEMENT_TYPE ); } -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) return mixedRef; - if ("string" !== typeof mixedRef) - if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) - mixedRef = "" + mixedRef; - else return mixedRef; - var callback = stringRefAsCallbackRef.bind(null, mixedRef, type, owner); - callback.__stringRef = mixedRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!disableStringRefs) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - type = owner.stateNode; - if (!type) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); - } -} function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; return ( @@ -475,15 +411,9 @@ exports.cloneElement = function (element, config, children) { ); var props = assign({}, element.props), key = element.key, - ref = enableRefAsProp ? null : element.ref, - owner = disableStringRefs ? void 0 : element._owner; + owner = void 0; if (null != config) { - void 0 !== config.ref && - ((owner = disableStringRefs ? void 0 : getOwner()), - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || - (ref = coerceStringRef(ref, owner, element.type)))); + void 0 !== config.ref && (owner = void 0); void 0 !== config.key && (key = "" + config.key); if ( !disableDefaultPropsExceptForClasses && @@ -494,21 +424,15 @@ exports.cloneElement = function (element, config, children) { for (propName in config) !hasOwnProperty.call(config, propName) || "key" === propName || - (!enableRefAsProp && "ref" === propName) || "__self" === propName || "__source" === propName || - (enableRefAsProp && "ref" === propName && void 0 === config.ref) || - (disableDefaultPropsExceptForClasses || - void 0 !== config[propName] || - void 0 === defaultProps - ? enableRefAsProp && !disableStringRefs && "ref" === propName - ? (props.ref = coerceStringRef( - config[propName], - owner, - element.type - )) - : (props[propName] = config[propName]) - : (props[propName] = defaultProps[propName])); + ("ref" === propName && void 0 === config.ref) || + (props[propName] = + disableDefaultPropsExceptForClasses || + void 0 !== config[propName] || + void 0 === defaultProps + ? config[propName] + : defaultProps[propName]); } var propName = arguments.length - 2; if (1 === propName) props.children = children; @@ -517,7 +441,7 @@ exports.cloneElement = function (element, config, children) { for (var i = 0; i < propName; i++) defaultProps[i] = arguments[i + 2]; props.children = defaultProps; } - return ReactElement(element.type, key, ref, void 0, void 0, owner, props); + return ReactElement(element.type, key, null, void 0, void 0, owner, props); }; exports.createContext = function (defaultValue) { defaultValue = { @@ -538,23 +462,14 @@ exports.createContext = function (defaultValue) { exports.createElement = function (type, config, children) { var propName, props = {}, - key = null, - ref = null; + key = null; if (null != config) - for (propName in (void 0 === config.ref || - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || (ref = coerceStringRef(ref, getOwner(), type))), - void 0 !== config.key && (key = "" + config.key), - config)) + for (propName in (void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && "key" !== propName && - (enableRefAsProp || "ref" !== propName) && "__self" !== propName && "__source" !== propName && - (enableRefAsProp && !disableStringRefs && "ref" === propName - ? (props.ref = coerceStringRef(config[propName], getOwner(), type)) - : (props[propName] = config[propName])); + (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (1 < childrenLength) { @@ -566,7 +481,7 @@ exports.createElement = function (type, config, children) { for (propName in ((childrenLength = type.defaultProps), childrenLength)) void 0 === props[propName] && (props[propName] = childrenLength[propName]); - return ReactElement(type, key, ref, void 0, void 0, getOwner(), props); + return ReactElement(type, key, null, void 0, void 0, null, props); }; exports.createRef = function () { return { current: null }; @@ -689,4 +604,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-rc-5bb1a051"; +exports.version = "19.0.0-rc-d03b5f88"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js index 5b2073fbd8..9fc2f71c51 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<602f7d0c17188d2b168ae473894b1450>> + * @generated SignedSource<<6b31810711d4bd421bdf65bafdf70c01>> */ "use strict"; @@ -18,9 +18,7 @@ var dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableFastJSX = dynamicFlagsUntyped.enableFastJSX, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -91,46 +89,23 @@ assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = !0; var isArrayImpl = Array.isArray, ReactSharedInternals = { H: null, A: null, T: null }, - hasOwnProperty = Object.prototype.hasOwnProperty; -function getOwner() { - if (!disableStringRefs) { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - return null; -} -var enableFastJSXWithStringRefs = enableFastJSX && enableRefAsProp, - enableFastJSXWithoutStringRefs = - enableFastJSXWithStringRefs && disableStringRefs; + hasOwnProperty = Object.prototype.hasOwnProperty, + enableFastJSXWithStringRefs = enableFastJSX && !0, + enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !0; function ReactElement(type, key, _ref, self, source, owner, props) { - enableRefAsProp && - ((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null)); - return disableStringRefs - ? { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: _ref, - props: props - } - : { - $$typeof: REACT_LEGACY_ELEMENT_TYPE, - type: type, - key: key, - ref: _ref, - props: props, - _owner: owner - }; + _ref = props.ref; + return { + $$typeof: REACT_LEGACY_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== _ref ? _ref : null, + props: props + }; } function jsxProd(type, config, maybeKey) { - var key = null, - ref = null; + var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - void 0 === config.ref || - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || (ref = coerceStringRef(ref, getOwner(), type))); if ( (!enableFastJSXWithoutStringRefs && (!enableFastJSXWithStringRefs || "ref" in config)) || @@ -138,11 +113,7 @@ function jsxProd(type, config, maybeKey) { ) { maybeKey = {}; for (var propName in config) - "key" === propName || - (!enableRefAsProp && "ref" === propName) || - (enableRefAsProp && !disableStringRefs && "ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + "key" !== propName && (maybeKey[propName] = config[propName]); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -150,16 +121,16 @@ function jsxProd(type, config, maybeKey) { void 0 === maybeKey[propName$0] && (maybeKey[propName$0] = config[propName$0]); } - return ReactElement(type, key, ref, void 0, void 0, getOwner(), maybeKey); + return ReactElement(type, key, null, void 0, void 0, null, maybeKey); } function cloneAndReplaceKey(oldElement, newKey) { return ReactElement( oldElement.type, newKey, - enableRefAsProp ? null : oldElement.ref, + null, + void 0, void 0, void 0, - disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -170,41 +141,6 @@ function isValidElement(object) { object.$$typeof === REACT_LEGACY_ELEMENT_TYPE ); } -function coerceStringRef(mixedRef, owner, type) { - if (disableStringRefs) return mixedRef; - if ("string" !== typeof mixedRef) - if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) - mixedRef = "" + mixedRef; - else return mixedRef; - var callback = stringRefAsCallbackRef.bind(null, mixedRef, type, owner); - callback.__stringRef = mixedRef; - callback.__type = type; - callback.__owner = owner; - return callback; -} -function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!disableStringRefs) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - type = owner.stateNode; - if (!type) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); - } -} function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; return ( @@ -479,15 +415,9 @@ exports.cloneElement = function (element, config, children) { ); var props = assign({}, element.props), key = element.key, - ref = enableRefAsProp ? null : element.ref, - owner = disableStringRefs ? void 0 : element._owner; + owner = void 0; if (null != config) { - void 0 !== config.ref && - ((owner = disableStringRefs ? void 0 : getOwner()), - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || - (ref = coerceStringRef(ref, owner, element.type)))); + void 0 !== config.ref && (owner = void 0); void 0 !== config.key && (key = "" + config.key); if ( !disableDefaultPropsExceptForClasses && @@ -498,21 +428,15 @@ exports.cloneElement = function (element, config, children) { for (propName in config) !hasOwnProperty.call(config, propName) || "key" === propName || - (!enableRefAsProp && "ref" === propName) || "__self" === propName || "__source" === propName || - (enableRefAsProp && "ref" === propName && void 0 === config.ref) || - (disableDefaultPropsExceptForClasses || - void 0 !== config[propName] || - void 0 === defaultProps - ? enableRefAsProp && !disableStringRefs && "ref" === propName - ? (props.ref = coerceStringRef( - config[propName], - owner, - element.type - )) - : (props[propName] = config[propName]) - : (props[propName] = defaultProps[propName])); + ("ref" === propName && void 0 === config.ref) || + (props[propName] = + disableDefaultPropsExceptForClasses || + void 0 !== config[propName] || + void 0 === defaultProps + ? config[propName] + : defaultProps[propName]); } var propName = arguments.length - 2; if (1 === propName) props.children = children; @@ -521,7 +445,7 @@ exports.cloneElement = function (element, config, children) { for (var i = 0; i < propName; i++) defaultProps[i] = arguments[i + 2]; props.children = defaultProps; } - return ReactElement(element.type, key, ref, void 0, void 0, owner, props); + return ReactElement(element.type, key, null, void 0, void 0, owner, props); }; exports.createContext = function (defaultValue) { defaultValue = { @@ -542,23 +466,14 @@ exports.createContext = function (defaultValue) { exports.createElement = function (type, config, children) { var propName, props = {}, - key = null, - ref = null; + key = null; if (null != config) - for (propName in (void 0 === config.ref || - enableRefAsProp || - ((ref = config.ref), - disableStringRefs || (ref = coerceStringRef(ref, getOwner(), type))), - void 0 !== config.key && (key = "" + config.key), - config)) + for (propName in (void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && "key" !== propName && - (enableRefAsProp || "ref" !== propName) && "__self" !== propName && "__source" !== propName && - (enableRefAsProp && !disableStringRefs && "ref" === propName - ? (props.ref = coerceStringRef(config[propName], getOwner(), type)) - : (props[propName] = config[propName])); + (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (1 < childrenLength) { @@ -570,7 +485,7 @@ exports.createElement = function (type, config, children) { for (propName in ((childrenLength = type.defaultProps), childrenLength)) void 0 === props[propName] && (props[propName] = childrenLength[propName]); - return ReactElement(type, key, ref, void 0, void 0, getOwner(), props); + return ReactElement(type, key, null, void 0, void 0, null, props); }; exports.createRef = function () { return { current: null }; @@ -693,7 +608,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-rc-26f66c0f"; +exports.version = "19.0.0-rc-8d1b9547"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index e1bd931ee3..c499e95fe1 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -915b914b3a05b60590c75851464e1ca75249976d +7621466b1b17965032aed24591e9b67fcd926a1b diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index 96fca84500..b07f501974 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ 'use strict'; @@ -1992,11 +1992,9 @@ var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-e var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries, consoleManagedByDevToolsDuringStrictMode = dynamicFlags.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlags.disableStringRefs, enableAddPropertiesFastPath = dynamicFlags.enableAddPropertiesFastPath, enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask, enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection, - enableRefAsProp = dynamicFlags.enableRefAsProp, passChildrenWhenCloningPersistedNodes = dynamicFlags.passChildrenWhenCloningPersistedNodes; // The rest of the flags are static for better dead code elimination. var enableAsyncActions = true; var enableSchedulingProfiler = true; @@ -7794,21 +7792,6 @@ function shallowEqual(objA, objB) { var current = null; var isRendering = false; -function getCurrentFiberOwnerNameInDevOrNull() { - { - if (current === null) { - return null; - } - - var owner = current._debugOwner; - - if (owner != null) { - return getComponentNameFromOwner(owner); - } - } - - return null; -} function getCurrentFiberStackInDev() { { @@ -8401,15 +8384,12 @@ function unwrapThenable(thenable) { function coerceRef(returnFiber, current, workInProgress, element) { var ref; - if (enableRefAsProp) { + { // TODO: This is a temporary, intermediate step. When enableRefAsProp is on, // we should resolve the `ref` prop during the begin phase of the component // it's attached to (HostComponent, ClassComponent, etc). var refProp = element.props.ref; ref = refProp !== undefined ? refProp : null; - } else { - // Old behavior. - ref = element.ref; } // TODO: If enableRefAsProp is on, we shouldn't use the `ref` field. We // should always read the ref from the prop. @@ -14271,7 +14251,7 @@ function resolveClassComponentProps(Component, baseProps, // Only resolve defaul alreadyResolvedDefaultProps) { var newProps = baseProps; - if (enableRefAsProp) { + { // Remove ref from the props object, if it exists. if ('ref' in baseProps) { newProps = {}; @@ -14900,7 +14880,6 @@ var didReceiveUpdate = false; var didWarnAboutBadClass; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; -var didWarnAboutFunctionRefs; var didWarnAboutReassigningProps; var didWarnAboutRevealOrder; var didWarnAboutTailOptions; @@ -14910,7 +14889,6 @@ var didWarnAboutDefaultPropsOnFunctionComponent; didWarnAboutBadClass = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; - didWarnAboutFunctionRefs = {}; didWarnAboutReassigningProps = false; didWarnAboutRevealOrder = {}; didWarnAboutTailOptions = {}; @@ -14959,7 +14937,7 @@ function updateForwardRef(current, workInProgress, Component, nextProps, renderL var ref = workInProgress.ref; var propsWithoutRef; - if (enableRefAsProp && 'ref' in nextProps) { + if ('ref' in nextProps) { // `ref` is just a prop now, but `forwardRef` expects it to not appear in // the props object. This used to happen in the JSX runtime, but now we do // it here. @@ -15405,19 +15383,6 @@ function markRef(current, workInProgress) { } if (current === null || current.ref !== ref) { - if (!disableStringRefs && current !== null) { - var oldRef = current.ref; - var newRef = ref; - - if (typeof oldRef === 'function' && typeof newRef === 'function' && typeof oldRef.__stringRef === 'string' && oldRef.__stringRef === newRef.__stringRef && oldRef.__stringRefType === newRef.__stringRefType && oldRef.__stringRefOwner === newRef.__stringRefOwner) { - // Although this is a different callback, it represents the same - // string ref. To avoid breaking old Meta code that relies on string - // refs only being attached once, reuse the old ref. This will - // prevent us from detaching and reattaching the ref on each update. - workInProgress.ref = oldRef; - return; - } - } // Schedule a Ref effect workInProgress.flags |= Ref | RefStatic; @@ -15912,24 +15877,6 @@ function validateFunctionComponentInDev(workInProgress, Component) { } } - if (!enableRefAsProp && workInProgress.ref !== null) { - var info = ''; - var componentName = getComponentNameFromType(Component) || 'Unknown'; - var ownerName = getCurrentFiberOwnerNameInDevOrNull(); - - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - - var warningKey = componentName + '|' + (ownerName || ''); - - if (!didWarnAboutFunctionRefs[warningKey]) { - didWarnAboutFunctionRefs[warningKey] = true; - - error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); - } - } - if (!disableDefaultPropsExceptForClasses && Component.defaultProps !== undefined) { var _componentName = getComponentNameFromType(Component) || 'Unknown'; @@ -20229,7 +20176,7 @@ function commitAttachRef(finishedWork) { { // TODO: We should move these warnings to happen during the render // phase (markRef). - if (disableStringRefs && typeof ref === 'string') { + if (typeof ref === 'string') { error('String refs are no longer supported.'); } else if (!ref.hasOwnProperty('current')) { error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentNameFromFiber(finishedWork)); @@ -26087,7 +26034,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-79d761af'; +var ReactVersion = '19.0.0-rc-7ae4ed4c'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 7db7b36d8a..2f3e74f9f4 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3c9da8b1a20c2a64d5902762d2d5248f>> + * @generated SignedSource<> */ "use strict"; @@ -970,13 +970,11 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, passChildrenWhenCloningPersistedNodes = dynamicFlagsUntyped.passChildrenWhenCloningPersistedNodes, emptyObject$1 = {}, @@ -1810,7 +1808,6 @@ function getComponentNameFromFiber(fiber) { } return null; } -var currentOwner = null; function getNearestMountedFiber(fiber) { var node = fiber, nearestMounted = fiber; @@ -2905,11 +2902,8 @@ function unwrapThenable(thenable) { return trackUsedThenable(thenableState$1, thenable, index); } function coerceRef(returnFiber, current, workInProgress, element) { - enableRefAsProp - ? ((returnFiber = element.props.ref), - (returnFiber = void 0 !== returnFiber ? returnFiber : null)) - : (returnFiber = element.ref); - workInProgress.ref = returnFiber; + returnFiber = element.props.ref; + workInProgress.ref = void 0 !== returnFiber ? returnFiber : null; } function throwOnInvalidObjectType(returnFiber, newChild) { if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) @@ -5028,7 +5022,7 @@ function resolveClassComponentProps( alreadyResolvedDefaultProps ) { var newProps = baseProps; - if (enableRefAsProp && "ref" in baseProps) { + if ("ref" in baseProps) { newProps = {}; for (var propName in baseProps) "ref" !== propName && (newProps[propName] = baseProps[propName]); @@ -5328,7 +5322,7 @@ function updateForwardRef( ) { Component = Component.render; var ref = workInProgress.ref; - if (enableRefAsProp && "ref" in nextProps) { + if ("ref" in nextProps) { var propsWithoutRef = {}; for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); @@ -5524,23 +5518,8 @@ function markRef(current, workInProgress) { throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - if (null === current || current.ref !== ref) { - if ( - !disableStringRefs && - null !== current && - ((current = current.ref), - "function" === typeof current && - "function" === typeof ref && - "string" === typeof current.__stringRef && - current.__stringRef === ref.__stringRef && - current.__stringRefType === ref.__stringRefType && - current.__stringRefOwner === ref.__stringRefOwner) - ) { - workInProgress.ref = current; - return; - } + if (null === current || current.ref !== ref) workInProgress.flags |= 2097664; - } } } function updateFunctionComponent( @@ -5821,7 +5800,6 @@ function finishClassComponent( bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); shouldUpdate = workInProgress.stateNode; - disableStringRefs || (currentOwner = workInProgress); var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null @@ -8937,20 +8915,16 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( } } var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - } -}; -disableStringRefs || - (DefaultAsyncDispatcher.getOwner = function () { - return currentOwner; - }); -var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -9371,7 +9345,6 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - disableStringRefs || (currentOwner = null); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); var handler = suspenseHandlerStackCursor.current; @@ -9591,7 +9564,6 @@ function performUnitOfWork(unitOfWork) { var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); - disableStringRefs || (currentOwner = null); } function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; @@ -9647,7 +9619,6 @@ function replaySuspendedUnitOfWork(unitOfWork) { null === current ? completeUnitOfWork(unitOfWork) : (workInProgress = current); - disableStringRefs || (currentOwner = null); } function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { resetContextDependencies(); @@ -9802,7 +9773,6 @@ function commitRootImpl( currentUpdatePriority = 2; var prevExecutionContext = executionContext; executionContext |= 4; - disableStringRefs || (currentOwner = null); commitBeforeMutationEffects(root, finishedWork); commitMutationEffectsOnFiber(finishedWork, root); root.current = finishedWork; @@ -10576,10 +10546,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1124 = { + devToolsConfig$jscomp$inline_1114 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-rc-086e14ed", + version: "19.0.0-rc-40a71621", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10595,11 +10565,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1356 = { - bundleType: devToolsConfig$jscomp$inline_1124.bundleType, - version: devToolsConfig$jscomp$inline_1124.version, - rendererPackageName: devToolsConfig$jscomp$inline_1124.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1124.rendererConfig, +var internals$jscomp$inline_1346 = { + bundleType: devToolsConfig$jscomp$inline_1114.bundleType, + version: devToolsConfig$jscomp$inline_1114.version, + rendererPackageName: devToolsConfig$jscomp$inline_1114.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1114.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10615,26 +10585,26 @@ var internals$jscomp$inline_1356 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1124.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1114.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-086e14ed" + reconcilerVersion: "19.0.0-rc-40a71621" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1357 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1347 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1357.isDisabled && - hook$jscomp$inline_1357.supportsFiber + !hook$jscomp$inline_1347.isDisabled && + hook$jscomp$inline_1347.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1357.inject( - internals$jscomp$inline_1356 + (rendererID = hook$jscomp$inline_1347.inject( + internals$jscomp$inline_1346 )), - (injectedHook = hook$jscomp$inline_1357); + (injectedHook = hook$jscomp$inline_1347); } catch (err) {} } exports.createPortal = function (children, containerTag) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index e3fba894eb..65d5468f11 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<0374c4a21842dbd2133ac56c8fae0c36>> + * @generated SignedSource<> */ "use strict"; @@ -974,13 +974,11 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, passChildrenWhenCloningPersistedNodes = dynamicFlagsUntyped.passChildrenWhenCloningPersistedNodes, emptyObject$1 = {}, @@ -1932,7 +1930,6 @@ function getComponentNameFromFiber(fiber) { } return null; } -var currentOwner = null; function getNearestMountedFiber(fiber) { var node = fiber, nearestMounted = fiber; @@ -3027,11 +3024,8 @@ function unwrapThenable(thenable) { return trackUsedThenable(thenableState$1, thenable, index); } function coerceRef(returnFiber, current, workInProgress, element) { - enableRefAsProp - ? ((returnFiber = element.props.ref), - (returnFiber = void 0 !== returnFiber ? returnFiber : null)) - : (returnFiber = element.ref); - workInProgress.ref = returnFiber; + returnFiber = element.props.ref; + workInProgress.ref = void 0 !== returnFiber ? returnFiber : null; } function throwOnInvalidObjectType(returnFiber, newChild) { if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) @@ -5220,7 +5214,7 @@ function resolveClassComponentProps( alreadyResolvedDefaultProps ) { var newProps = baseProps; - if (enableRefAsProp && "ref" in baseProps) { + if ("ref" in baseProps) { newProps = {}; for (var propName in baseProps) "ref" !== propName && (newProps[propName] = baseProps[propName]); @@ -5521,7 +5515,7 @@ function updateForwardRef( ) { Component = Component.render; var ref = workInProgress.ref; - if (enableRefAsProp && "ref" in nextProps) { + if ("ref" in nextProps) { var propsWithoutRef = {}; for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); @@ -5719,23 +5713,8 @@ function markRef(current, workInProgress) { throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - if (null === current || current.ref !== ref) { - if ( - !disableStringRefs && - null !== current && - ((current = current.ref), - "function" === typeof current && - "function" === typeof ref && - "string" === typeof current.__stringRef && - current.__stringRef === ref.__stringRef && - current.__stringRefType === ref.__stringRefType && - current.__stringRefOwner === ref.__stringRefOwner) - ) { - workInProgress.ref = current; - return; - } + if (null === current || current.ref !== ref) workInProgress.flags |= 2097664; - } } } function updateFunctionComponent( @@ -6020,7 +5999,6 @@ function finishClassComponent( bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); shouldUpdate = workInProgress.stateNode; - disableStringRefs || (currentOwner = workInProgress); if ( didCaptureError && "function" !== typeof Component.getDerivedStateFromError @@ -9464,20 +9442,16 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( } } var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - } -}; -disableStringRefs || - (DefaultAsyncDispatcher.getOwner = function () { - return currentOwner; - }); -var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -9903,7 +9877,6 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - disableStringRefs || (currentOwner = null); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); var handler = suspenseHandlerStackCursor.current; @@ -10187,7 +10160,6 @@ function performUnitOfWork(unitOfWork) { null === current ? completeUnitOfWork(unitOfWork) : (workInProgress = current); - disableStringRefs || (currentOwner = null); } function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate, @@ -10246,7 +10218,6 @@ function replaySuspendedUnitOfWork(unitOfWork) { null === current ? completeUnitOfWork(unitOfWork) : (workInProgress = current); - disableStringRefs || (currentOwner = null); } function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { resetContextDependencies(); @@ -10413,7 +10384,6 @@ function commitRootImpl( currentUpdatePriority = 2; var prevExecutionContext = executionContext; executionContext |= 4; - disableStringRefs || (currentOwner = null); commitBeforeMutationEffects(root, finishedWork); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); @@ -11281,10 +11251,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1204 = { + devToolsConfig$jscomp$inline_1194 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-rc-d0d9e719", + version: "19.0.0-rc-a92b9434", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11314,10 +11284,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1204.bundleType, - version: devToolsConfig$jscomp$inline_1204.version, - rendererPackageName: devToolsConfig$jscomp$inline_1204.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1204.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1194.bundleType, + version: devToolsConfig$jscomp$inline_1194.version, + rendererPackageName: devToolsConfig$jscomp$inline_1194.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1194.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -11333,14 +11303,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1204.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1194.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-d0d9e719" + reconcilerVersion: "19.0.0-rc-a92b9434" }); exports.createPortal = function (children, containerTag) { return createPortal$1( diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 8f43df0d3a..56a756d531 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<474b9244c3c9a13025741c295280cf4c>> + * @generated SignedSource<> */ 'use strict'; @@ -2340,10 +2340,8 @@ var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-e var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries, consoleManagedByDevToolsDuringStrictMode = dynamicFlags.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlags.disableStringRefs, enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask, - enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection, - enableRefAsProp = dynamicFlags.enableRefAsProp; + enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection; // The rest of the flags are static for better dead code elimination. var enableAsyncActions = true; var enableSchedulingProfiler = true; @@ -7971,21 +7969,6 @@ function shallowEqual(objA, objB) { var current = null; var isRendering = false; -function getCurrentFiberOwnerNameInDevOrNull() { - { - if (current === null) { - return null; - } - - var owner = current._debugOwner; - - if (owner != null) { - return getComponentNameFromOwner(owner); - } - } - - return null; -} function getCurrentFiberStackInDev() { { @@ -8578,15 +8561,12 @@ function unwrapThenable(thenable) { function coerceRef(returnFiber, current, workInProgress, element) { var ref; - if (enableRefAsProp) { + { // TODO: This is a temporary, intermediate step. When enableRefAsProp is on, // we should resolve the `ref` prop during the begin phase of the component // it's attached to (HostComponent, ClassComponent, etc). var refProp = element.props.ref; ref = refProp !== undefined ? refProp : null; - } else { - // Old behavior. - ref = element.ref; } // TODO: If enableRefAsProp is on, we shouldn't use the `ref` field. We // should always read the ref from the prop. @@ -14448,7 +14428,7 @@ function resolveClassComponentProps(Component, baseProps, // Only resolve defaul alreadyResolvedDefaultProps) { var newProps = baseProps; - if (enableRefAsProp) { + { // Remove ref from the props object, if it exists. if ('ref' in baseProps) { newProps = {}; @@ -15077,7 +15057,6 @@ var didReceiveUpdate = false; var didWarnAboutBadClass; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; -var didWarnAboutFunctionRefs; var didWarnAboutReassigningProps; var didWarnAboutRevealOrder; var didWarnAboutTailOptions; @@ -15087,7 +15066,6 @@ var didWarnAboutDefaultPropsOnFunctionComponent; didWarnAboutBadClass = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; - didWarnAboutFunctionRefs = {}; didWarnAboutReassigningProps = false; didWarnAboutRevealOrder = {}; didWarnAboutTailOptions = {}; @@ -15136,7 +15114,7 @@ function updateForwardRef(current, workInProgress, Component, nextProps, renderL var ref = workInProgress.ref; var propsWithoutRef; - if (enableRefAsProp && 'ref' in nextProps) { + if ('ref' in nextProps) { // `ref` is just a prop now, but `forwardRef` expects it to not appear in // the props object. This used to happen in the JSX runtime, but now we do // it here. @@ -15582,19 +15560,6 @@ function markRef(current, workInProgress) { } if (current === null || current.ref !== ref) { - if (!disableStringRefs && current !== null) { - var oldRef = current.ref; - var newRef = ref; - - if (typeof oldRef === 'function' && typeof newRef === 'function' && typeof oldRef.__stringRef === 'string' && oldRef.__stringRef === newRef.__stringRef && oldRef.__stringRefType === newRef.__stringRefType && oldRef.__stringRefOwner === newRef.__stringRefOwner) { - // Although this is a different callback, it represents the same - // string ref. To avoid breaking old Meta code that relies on string - // refs only being attached once, reuse the old ref. This will - // prevent us from detaching and reattaching the ref on each update. - workInProgress.ref = oldRef; - return; - } - } // Schedule a Ref effect workInProgress.flags |= Ref | RefStatic; @@ -16089,24 +16054,6 @@ function validateFunctionComponentInDev(workInProgress, Component) { } } - if (!enableRefAsProp && workInProgress.ref !== null) { - var info = ''; - var componentName = getComponentNameFromType(Component) || 'Unknown'; - var ownerName = getCurrentFiberOwnerNameInDevOrNull(); - - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - - var warningKey = componentName + '|' + (ownerName || ''); - - if (!didWarnAboutFunctionRefs[warningKey]) { - didWarnAboutFunctionRefs[warningKey] = true; - - error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); - } - } - if (!disableDefaultPropsExceptForClasses && Component.defaultProps !== undefined) { var _componentName = getComponentNameFromType(Component) || 'Unknown'; @@ -20286,7 +20233,7 @@ function commitAttachRef(finishedWork) { { // TODO: We should move these warnings to happen during the render // phase (markRef). - if (disableStringRefs && typeof ref === 'string') { + if (typeof ref === 'string') { error('String refs are no longer supported.'); } else if (!ref.hasOwnProperty('current')) { error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentNameFromFiber(finishedWork)); @@ -26437,7 +26384,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-f6541054'; +var ReactVersion = '19.0.0-rc-4c4395fb'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 14e14fbfd6..eca5993170 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<579d7df14fefede0635f3015ce4ffc4b>> + * @generated SignedSource<> */ "use strict"; @@ -1115,12 +1115,10 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -1257,7 +1255,6 @@ function getComponentNameFromFiber(fiber) { } return null; } -var currentOwner = null; function getNearestMountedFiber(fiber) { var node = fiber, nearestMounted = fiber; @@ -2928,11 +2925,8 @@ function unwrapThenable(thenable) { return trackUsedThenable(thenableState$1, thenable, index); } function coerceRef(returnFiber, current, workInProgress, element) { - enableRefAsProp - ? ((returnFiber = element.props.ref), - (returnFiber = void 0 !== returnFiber ? returnFiber : null)) - : (returnFiber = element.ref); - workInProgress.ref = returnFiber; + returnFiber = element.props.ref; + workInProgress.ref = void 0 !== returnFiber ? returnFiber : null; } function throwOnInvalidObjectType(returnFiber, newChild) { if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) @@ -5051,7 +5045,7 @@ function resolveClassComponentProps( alreadyResolvedDefaultProps ) { var newProps = baseProps; - if (enableRefAsProp && "ref" in baseProps) { + if ("ref" in baseProps) { newProps = {}; for (var propName in baseProps) "ref" !== propName && (newProps[propName] = baseProps[propName]); @@ -5351,7 +5345,7 @@ function updateForwardRef( ) { Component = Component.render; var ref = workInProgress.ref; - if (enableRefAsProp && "ref" in nextProps) { + if ("ref" in nextProps) { var propsWithoutRef = {}; for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); @@ -5547,23 +5541,8 @@ function markRef(current, workInProgress) { throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - if (null === current || current.ref !== ref) { - if ( - !disableStringRefs && - null !== current && - ((current = current.ref), - "function" === typeof current && - "function" === typeof ref && - "string" === typeof current.__stringRef && - current.__stringRef === ref.__stringRef && - current.__stringRefType === ref.__stringRefType && - current.__stringRefOwner === ref.__stringRefOwner) - ) { - workInProgress.ref = current; - return; - } + if (null === current || current.ref !== ref) workInProgress.flags |= 2097664; - } } } function updateFunctionComponent( @@ -5844,7 +5823,6 @@ function finishClassComponent( bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); shouldUpdate = workInProgress.stateNode; - disableStringRefs || (currentOwner = workInProgress); var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null @@ -9117,20 +9095,16 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( } } var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - } -}; -disableStringRefs || - (DefaultAsyncDispatcher.getOwner = function () { - return currentOwner; - }); -var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -9553,7 +9527,6 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - disableStringRefs || (currentOwner = null); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); var handler = suspenseHandlerStackCursor.current; @@ -9773,7 +9746,6 @@ function performUnitOfWork(unitOfWork) { var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); - disableStringRefs || (currentOwner = null); } function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; @@ -9829,7 +9801,6 @@ function replaySuspendedUnitOfWork(unitOfWork) { null === current ? completeUnitOfWork(unitOfWork) : (workInProgress = current); - disableStringRefs || (currentOwner = null); } function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { resetContextDependencies(); @@ -9984,7 +9955,6 @@ function commitRootImpl( currentUpdatePriority = 2; var prevExecutionContext = executionContext; executionContext |= 4; - disableStringRefs || (currentOwner = null); commitBeforeMutationEffects(root, finishedWork); commitMutationEffectsOnFiber(finishedWork, root); root.current = finishedWork; @@ -10765,10 +10735,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1192 = { + devToolsConfig$jscomp$inline_1182 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-rc-f1237942", + version: "19.0.0-rc-701bd3df", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10784,11 +10754,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1441 = { - bundleType: devToolsConfig$jscomp$inline_1192.bundleType, - version: devToolsConfig$jscomp$inline_1192.version, - rendererPackageName: devToolsConfig$jscomp$inline_1192.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1192.rendererConfig, +var internals$jscomp$inline_1431 = { + bundleType: devToolsConfig$jscomp$inline_1182.bundleType, + version: devToolsConfig$jscomp$inline_1182.version, + rendererPackageName: devToolsConfig$jscomp$inline_1182.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1182.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10804,26 +10774,26 @@ var internals$jscomp$inline_1441 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1192.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1182.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-f1237942" + reconcilerVersion: "19.0.0-rc-701bd3df" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1442 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1432 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1442.isDisabled && - hook$jscomp$inline_1442.supportsFiber + !hook$jscomp$inline_1432.isDisabled && + hook$jscomp$inline_1432.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1442.inject( - internals$jscomp$inline_1441 + (rendererID = hook$jscomp$inline_1432.inject( + internals$jscomp$inline_1431 )), - (injectedHook = hook$jscomp$inline_1442); + (injectedHook = hook$jscomp$inline_1432); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 055d2455ec..bfff740f15 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<93fe9935111766fb9f8765d67d8a279a>> + * @generated SignedSource<<9ae22f6743741ff043022da819bd073c>> */ "use strict"; @@ -1119,12 +1119,10 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, - disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, - enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -1261,7 +1259,6 @@ function getComponentNameFromFiber(fiber) { } return null; } -var currentOwner = null; function getNearestMountedFiber(fiber) { var node = fiber, nearestMounted = fiber; @@ -3050,11 +3047,8 @@ function unwrapThenable(thenable) { return trackUsedThenable(thenableState$1, thenable, index); } function coerceRef(returnFiber, current, workInProgress, element) { - enableRefAsProp - ? ((returnFiber = element.props.ref), - (returnFiber = void 0 !== returnFiber ? returnFiber : null)) - : (returnFiber = element.ref); - workInProgress.ref = returnFiber; + returnFiber = element.props.ref; + workInProgress.ref = void 0 !== returnFiber ? returnFiber : null; } function throwOnInvalidObjectType(returnFiber, newChild) { if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) @@ -5243,7 +5237,7 @@ function resolveClassComponentProps( alreadyResolvedDefaultProps ) { var newProps = baseProps; - if (enableRefAsProp && "ref" in baseProps) { + if ("ref" in baseProps) { newProps = {}; for (var propName in baseProps) "ref" !== propName && (newProps[propName] = baseProps[propName]); @@ -5544,7 +5538,7 @@ function updateForwardRef( ) { Component = Component.render; var ref = workInProgress.ref; - if (enableRefAsProp && "ref" in nextProps) { + if ("ref" in nextProps) { var propsWithoutRef = {}; for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); @@ -5742,23 +5736,8 @@ function markRef(current, workInProgress) { throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - if (null === current || current.ref !== ref) { - if ( - !disableStringRefs && - null !== current && - ((current = current.ref), - "function" === typeof current && - "function" === typeof ref && - "string" === typeof current.__stringRef && - current.__stringRef === ref.__stringRef && - current.__stringRefType === ref.__stringRefType && - current.__stringRefOwner === ref.__stringRefOwner) - ) { - workInProgress.ref = current; - return; - } + if (null === current || current.ref !== ref) workInProgress.flags |= 2097664; - } } } function updateFunctionComponent( @@ -6043,7 +6022,6 @@ function finishClassComponent( bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); shouldUpdate = workInProgress.stateNode; - disableStringRefs || (currentOwner = workInProgress); if ( didCaptureError && "function" !== typeof Component.getDerivedStateFromError @@ -9645,20 +9623,16 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( } } var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - } -}; -disableStringRefs || - (DefaultAsyncDispatcher.getOwner = function () { - return currentOwner; - }); -var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -10086,7 +10060,6 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - disableStringRefs || (currentOwner = null); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); var handler = suspenseHandlerStackCursor.current; @@ -10370,7 +10343,6 @@ function performUnitOfWork(unitOfWork) { null === current ? completeUnitOfWork(unitOfWork) : (workInProgress = current); - disableStringRefs || (currentOwner = null); } function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate, @@ -10429,7 +10401,6 @@ function replaySuspendedUnitOfWork(unitOfWork) { null === current ? completeUnitOfWork(unitOfWork) : (workInProgress = current); - disableStringRefs || (currentOwner = null); } function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { resetContextDependencies(); @@ -10596,7 +10567,6 @@ function commitRootImpl( currentUpdatePriority = 2; var prevExecutionContext = executionContext; executionContext |= 4; - disableStringRefs || (currentOwner = null); commitBeforeMutationEffects(root, finishedWork); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); @@ -11471,10 +11441,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1272 = { + devToolsConfig$jscomp$inline_1262 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-rc-58c9faab", + version: "19.0.0-rc-433bdfbc", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11504,10 +11474,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1272.bundleType, - version: devToolsConfig$jscomp$inline_1272.version, - rendererPackageName: devToolsConfig$jscomp$inline_1272.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1272.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1262.bundleType, + version: devToolsConfig$jscomp$inline_1262.version, + rendererPackageName: devToolsConfig$jscomp$inline_1262.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1262.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -11523,14 +11493,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1272.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1262.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-58c9faab" + reconcilerVersion: "19.0.0-rc-433bdfbc" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {