diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index 35848eda5e..e5aa94be95 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<514c453e36455da8cb22e0c8c9169c24>> */ "use strict"; @@ -5067,18 +5067,17 @@ if (__DEV__) { element, mixedRef ) { + { + checkPropStringCoercion(mixedRef, "ref"); + } + + var stringRef = "" + mixedRef; var owner = element._owner; if (!owner) { - if (typeof mixedRef !== "string") { - throw new Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); - } - throw new Error( "Element ref was specified as a string (" + - mixedRef + + 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" + @@ -5095,15 +5094,8 @@ if (__DEV__) { "Learn more about using refs safely here: " + "https://reactjs.org/link/strict-mode-string-ref" ); - } // At this point, we know the ref isn't an object or function but it could - // be a number. Coerce it to a string. - - { - checkPropStringCoercion(mixedRef, "ref"); } - var stringRef = "" + mixedRef; - { if ( // Will already warn with "Function components cannot be given refs" @@ -5175,12 +5167,10 @@ if (__DEV__) { var coercedRef; if ( - mixedRef !== null && - typeof mixedRef !== "function" && - typeof mixedRef !== "object" + typeof mixedRef === "string" || + typeof mixedRef === "number" || + typeof mixedRef === "boolean" ) { - // Assume this is a string ref. If it's not, then this will throw an error - // to the user. coercedRef = convertStringRefToCallbackRef( returnFiber, current, @@ -13232,17 +13222,25 @@ if (__DEV__) { } function markRef(current, workInProgress) { - // TODO: This is also where we should check the type of the ref and error if - // an invalid one is passed, instead of during child reconcilation. + // TODO: Check props.ref instead of fiber.ref when enableRefAsProp is on. var ref = workInProgress.ref; - if ( - (current === null && ref !== null) || - (current !== null && current.ref !== ref) - ) { - // Schedule a Ref effect - workInProgress.flags |= Ref; - workInProgress.flags |= RefStatic; + if (ref === null) { + if (current !== null && current.ref !== null) { + // Schedule a Ref effect + workInProgress.flags |= Ref | RefStatic; + } + } else { + if (typeof ref !== "function" && typeof ref !== "object") { + throw new Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + } + + if (current === null || current.ref !== ref) { + // Schedule a Ref effect + workInProgress.flags |= Ref | RefStatic; + } } } @@ -25735,7 +25733,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-canary-bb4b147da-20240229"; + var ReactVersion = "18.3.0-canary-2f8f77602-20240229"; // Might add PROFILE later. diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index a17caff08d..f877e10027 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<74c9b737997575eb03bf09dfe096e458>> + * @generated SignedSource<> */ "use strict"; @@ -1464,24 +1464,19 @@ function convertStringRefToCallbackRef( var refs = inst.refs; null === value ? delete refs[stringRef] : (refs[stringRef] = value); } + var stringRef = "" + mixedRef; returnFiber = element._owner; - if (!returnFiber) { - if ("string" !== typeof mixedRef) - throw Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); + if (!returnFiber) throw Error( "Element ref was specified as a string (" + - mixedRef + + 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://reactjs.org/link/refs-must-have-owner for more information." ); - } if (1 !== returnFiber.tag) throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ); - var stringRef = "" + mixedRef, - inst = returnFiber.stateNode; + var inst = returnFiber.stateNode; if (!inst) throw Error( "Missing owner for string ref " + @@ -1501,9 +1496,9 @@ function convertStringRefToCallbackRef( function coerceRef(returnFiber, current, workInProgress, element) { var mixedRef = element.ref; returnFiber = - null !== mixedRef && - "function" !== typeof mixedRef && - "object" !== typeof mixedRef + "string" === typeof mixedRef || + "number" === typeof mixedRef || + "boolean" === typeof mixedRef ? convertStringRefToCallbackRef(returnFiber, current, element, mixedRef) : mixedRef; workInProgress.ref = returnFiber; @@ -3986,11 +3981,18 @@ function deferHiddenOffscreenComponent(current, workInProgress, nextBaseLanes) { } function markRef(current, workInProgress) { var ref = workInProgress.ref; - if ( - (null === current && null !== ref) || - (null !== current && current.ref !== ref) - ) - (workInProgress.flags |= 512), (workInProgress.flags |= 2097152); + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } function updateFunctionComponent( current, @@ -9171,7 +9173,7 @@ var devToolsConfig$jscomp$inline_1014 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-bb4b147da-20240229", + version: "18.3.0-canary-2f8f77602-20240229", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1195 = { @@ -9202,7 +9204,7 @@ var internals$jscomp$inline_1195 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-bb4b147da-20240229" + reconcilerVersion: "18.3.0-canary-2f8f77602-20240229" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1196 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 97debf22f7..5a272fb597 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<86e7f77200b19412957b194553a75177>> + * @generated SignedSource<<749ebcbb693ef8635dc1c79f3b3a628d>> */ "use strict"; @@ -1484,24 +1484,19 @@ function convertStringRefToCallbackRef( var refs = inst.refs; null === value ? delete refs[stringRef] : (refs[stringRef] = value); } + var stringRef = "" + mixedRef; returnFiber = element._owner; - if (!returnFiber) { - if ("string" !== typeof mixedRef) - throw Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); + if (!returnFiber) throw Error( "Element ref was specified as a string (" + - mixedRef + + 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://reactjs.org/link/refs-must-have-owner for more information." ); - } if (1 !== returnFiber.tag) throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ); - var stringRef = "" + mixedRef, - inst = returnFiber.stateNode; + var inst = returnFiber.stateNode; if (!inst) throw Error( "Missing owner for string ref " + @@ -1521,9 +1516,9 @@ function convertStringRefToCallbackRef( function coerceRef(returnFiber, current, workInProgress, element) { var mixedRef = element.ref; returnFiber = - null !== mixedRef && - "function" !== typeof mixedRef && - "object" !== typeof mixedRef + "string" === typeof mixedRef || + "number" === typeof mixedRef || + "boolean" === typeof mixedRef ? convertStringRefToCallbackRef(returnFiber, current, element, mixedRef) : mixedRef; workInProgress.ref = returnFiber; @@ -4068,11 +4063,18 @@ function deferHiddenOffscreenComponent(current, workInProgress, nextBaseLanes) { } function markRef(current, workInProgress) { var ref = workInProgress.ref; - if ( - (null === current && null !== ref) || - (null !== current && current.ref !== ref) - ) - (workInProgress.flags |= 512), (workInProgress.flags |= 2097152); + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } function updateFunctionComponent( current, @@ -9599,7 +9601,7 @@ var devToolsConfig$jscomp$inline_1056 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-bb4b147da-20240229", + version: "18.3.0-canary-2f8f77602-20240229", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1236 = { @@ -9630,7 +9632,7 @@ var internals$jscomp$inline_1236 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-bb4b147da-20240229" + reconcilerVersion: "18.3.0-canary-2f8f77602-20240229" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1237 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js index cc392af21d..189a245926 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js @@ -26,7 +26,7 @@ if (__DEV__) { } var dynamicFlags = require("ReactNativeInternalFeatureFlags"); - var ReactVersion = "18.3.0-canary-bb4b147da-20240229"; + var ReactVersion = "18.3.0-canary-2f8f77602-20240229"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js index d650a509e1..90af5b7e49 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js @@ -598,4 +598,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-bb4b147da-20240229"; +exports.version = "18.3.0-canary-2f8f77602-20240229"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js index 14d3891a8b..532ad4b9e0 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js @@ -594,7 +594,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-bb4b147da-20240229"; +exports.version = "18.3.0-canary-2f8f77602-20240229"; "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 4526de4b9f..474070d97b 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 @@ -bb4b147da9a892529995f55f15f19f46a00cf4f6 +2f8f7760223241665f472a2a9be16650473bce39 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 0b3a7c9ce5..8e424ca762 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<<409fcb610c96c788e5d00c80fb0cad50>> */ "use strict"; @@ -8976,18 +8976,17 @@ to return true:wantsResponderID| | element, mixedRef ) { + { + checkPropStringCoercion(mixedRef, "ref"); + } + + var stringRef = "" + mixedRef; var owner = element._owner; if (!owner) { - if (typeof mixedRef !== "string") { - throw new Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); - } - throw new Error( "Element ref was specified as a string (" + - mixedRef + + 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" + @@ -9004,15 +9003,8 @@ to return true:wantsResponderID| | "Learn more about using refs safely here: " + "https://reactjs.org/link/strict-mode-string-ref" ); - } // At this point, we know the ref isn't an object or function but it could - // be a number. Coerce it to a string. - - { - checkPropStringCoercion(mixedRef, "ref"); } - var stringRef = "" + mixedRef; - { if ( // Will already warn with "Function components cannot be given refs" @@ -9084,12 +9076,10 @@ to return true:wantsResponderID| | var coercedRef; if ( - mixedRef !== null && - typeof mixedRef !== "function" && - typeof mixedRef !== "object" + typeof mixedRef === "string" || + typeof mixedRef === "number" || + typeof mixedRef === "boolean" ) { - // Assume this is a string ref. If it's not, then this will throw an error - // to the user. coercedRef = convertStringRefToCallbackRef( returnFiber, current, @@ -16418,17 +16408,25 @@ to return true:wantsResponderID| | } function markRef(current, workInProgress) { - // TODO: This is also where we should check the type of the ref and error if - // an invalid one is passed, instead of during child reconcilation. + // TODO: Check props.ref instead of fiber.ref when enableRefAsProp is on. var ref = workInProgress.ref; - if ( - (current === null && ref !== null) || - (current !== null && current.ref !== ref) - ) { - // Schedule a Ref effect - workInProgress.flags |= Ref; - workInProgress.flags |= RefStatic; + if (ref === null) { + if (current !== null && current.ref !== null) { + // Schedule a Ref effect + workInProgress.flags |= Ref | RefStatic; + } + } else { + if (typeof ref !== "function" && typeof ref !== "object") { + throw new Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + } + + if (current === null || current.ref !== ref) { + // Schedule a Ref effect + workInProgress.flags |= Ref | RefStatic; + } } } @@ -28090,7 +28088,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "18.3.0-canary-b1191c0d"; + var ReactVersion = "18.3.0-canary-79e0cf8d"; function createPortal$1( children, 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 b1319a41d3..a02d5e4a49 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<> + * @generated SignedSource<<554f53e63c9c8753adcd614a35749b60>> */ "use strict"; @@ -2891,24 +2891,19 @@ function convertStringRefToCallbackRef( var refs = inst.refs; null === value ? delete refs[stringRef] : (refs[stringRef] = value); } + var stringRef = "" + mixedRef; returnFiber = element._owner; - if (!returnFiber) { - if ("string" !== typeof mixedRef) - throw Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); + if (!returnFiber) throw Error( "Element ref was specified as a string (" + - mixedRef + + 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://reactjs.org/link/refs-must-have-owner for more information." ); - } if (1 !== returnFiber.tag) throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ); - var stringRef = "" + mixedRef, - inst = returnFiber.stateNode; + var inst = returnFiber.stateNode; if (!inst) throw Error( "Missing owner for string ref " + @@ -2928,9 +2923,9 @@ function convertStringRefToCallbackRef( function coerceRef(returnFiber, current, workInProgress, element) { var mixedRef = element.ref; returnFiber = - null !== mixedRef && - "function" !== typeof mixedRef && - "object" !== typeof mixedRef + "string" === typeof mixedRef || + "number" === typeof mixedRef || + "boolean" === typeof mixedRef ? convertStringRefToCallbackRef(returnFiber, current, element, mixedRef) : mixedRef; workInProgress.ref = returnFiber; @@ -5123,11 +5118,18 @@ function deferHiddenOffscreenComponent(current, workInProgress, nextBaseLanes) { } function markRef(current, workInProgress) { var ref = workInProgress.ref; - if ( - (null === current && null !== ref) || - (null !== current && current.ref !== ref) - ) - (workInProgress.flags |= 512), (workInProgress.flags |= 2097152); + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } function updateFunctionComponent( current, @@ -9705,7 +9707,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1059 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-2f67afac", + version: "18.3.0-canary-241dc610", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9748,7 +9750,7 @@ var internals$jscomp$inline_1284 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-2f67afac" + reconcilerVersion: "18.3.0-canary-241dc610" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1285 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 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 a8729441c2..d225e0a7c5 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<<225029855a5d7573ff10fa1f1445bcaf>> + * @generated SignedSource<<22c727d3b43debc1d3b0419f1de92333>> */ "use strict"; @@ -3016,24 +3016,19 @@ function convertStringRefToCallbackRef( var refs = inst.refs; null === value ? delete refs[stringRef] : (refs[stringRef] = value); } + var stringRef = "" + mixedRef; returnFiber = element._owner; - if (!returnFiber) { - if ("string" !== typeof mixedRef) - throw Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); + if (!returnFiber) throw Error( "Element ref was specified as a string (" + - mixedRef + + 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://reactjs.org/link/refs-must-have-owner for more information." ); - } if (1 !== returnFiber.tag) throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ); - var stringRef = "" + mixedRef, - inst = returnFiber.stateNode; + var inst = returnFiber.stateNode; if (!inst) throw Error( "Missing owner for string ref " + @@ -3053,9 +3048,9 @@ function convertStringRefToCallbackRef( function coerceRef(returnFiber, current, workInProgress, element) { var mixedRef = element.ref; returnFiber = - null !== mixedRef && - "function" !== typeof mixedRef && - "object" !== typeof mixedRef + "string" === typeof mixedRef || + "number" === typeof mixedRef || + "boolean" === typeof mixedRef ? convertStringRefToCallbackRef(returnFiber, current, element, mixedRef) : mixedRef; workInProgress.ref = returnFiber; @@ -5320,11 +5315,18 @@ function deferHiddenOffscreenComponent(current, workInProgress, nextBaseLanes) { } function markRef(current, workInProgress) { var ref = workInProgress.ref; - if ( - (null === current && null !== ref) || - (null !== current && current.ref !== ref) - ) - (workInProgress.flags |= 512), (workInProgress.flags |= 2097152); + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } function updateFunctionComponent( current, @@ -10407,7 +10409,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1137 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-22c30fbb", + version: "18.3.0-canary-3d21d46a", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10463,7 +10465,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-22c30fbb" + reconcilerVersion: "18.3.0-canary-3d21d46a" }); 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 b6e48491e2..f2fc664660 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<> + * @generated SignedSource<<8115bda793528a085e7459e0166827d3>> */ "use strict"; @@ -9247,18 +9247,17 @@ to return true:wantsResponderID| | element, mixedRef ) { + { + checkPropStringCoercion(mixedRef, "ref"); + } + + var stringRef = "" + mixedRef; var owner = element._owner; if (!owner) { - if (typeof mixedRef !== "string") { - throw new Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); - } - throw new Error( "Element ref was specified as a string (" + - mixedRef + + 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" + @@ -9275,15 +9274,8 @@ to return true:wantsResponderID| | "Learn more about using refs safely here: " + "https://reactjs.org/link/strict-mode-string-ref" ); - } // At this point, we know the ref isn't an object or function but it could - // be a number. Coerce it to a string. - - { - checkPropStringCoercion(mixedRef, "ref"); } - var stringRef = "" + mixedRef; - { if ( // Will already warn with "Function components cannot be given refs" @@ -9355,12 +9347,10 @@ to return true:wantsResponderID| | var coercedRef; if ( - mixedRef !== null && - typeof mixedRef !== "function" && - typeof mixedRef !== "object" + typeof mixedRef === "string" || + typeof mixedRef === "number" || + typeof mixedRef === "boolean" ) { - // Assume this is a string ref. If it's not, then this will throw an error - // to the user. coercedRef = convertStringRefToCallbackRef( returnFiber, current, @@ -16689,17 +16679,25 @@ to return true:wantsResponderID| | } function markRef(current, workInProgress) { - // TODO: This is also where we should check the type of the ref and error if - // an invalid one is passed, instead of during child reconcilation. + // TODO: Check props.ref instead of fiber.ref when enableRefAsProp is on. var ref = workInProgress.ref; - if ( - (current === null && ref !== null) || - (current !== null && current.ref !== ref) - ) { - // Schedule a Ref effect - workInProgress.flags |= Ref; - workInProgress.flags |= RefStatic; + if (ref === null) { + if (current !== null && current.ref !== null) { + // Schedule a Ref effect + workInProgress.flags |= Ref | RefStatic; + } + } else { + if (typeof ref !== "function" && typeof ref !== "object") { + throw new Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + } + + if (current === null || current.ref !== ref) { + // Schedule a Ref effect + workInProgress.flags |= Ref | RefStatic; + } } } @@ -28530,7 +28528,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "18.3.0-canary-58d268df"; + var ReactVersion = "18.3.0-canary-951ec3ac"; function createPortal$1( children, 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 b726256377..41123c6b1d 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<> + * @generated SignedSource<<5851ed8034e7e6767df6c7658646bfa3>> */ "use strict"; @@ -2956,24 +2956,19 @@ function convertStringRefToCallbackRef( var refs = inst.refs; null === value ? delete refs[stringRef] : (refs[stringRef] = value); } + var stringRef = "" + mixedRef; returnFiber = element._owner; - if (!returnFiber) { - if ("string" !== typeof mixedRef) - throw Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); + if (!returnFiber) throw Error( "Element ref was specified as a string (" + - mixedRef + + 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://reactjs.org/link/refs-must-have-owner for more information." ); - } if (1 !== returnFiber.tag) throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ); - var stringRef = "" + mixedRef, - inst = returnFiber.stateNode; + var inst = returnFiber.stateNode; if (!inst) throw Error( "Missing owner for string ref " + @@ -2993,9 +2988,9 @@ function convertStringRefToCallbackRef( function coerceRef(returnFiber, current, workInProgress, element) { var mixedRef = element.ref; returnFiber = - null !== mixedRef && - "function" !== typeof mixedRef && - "object" !== typeof mixedRef + "string" === typeof mixedRef || + "number" === typeof mixedRef || + "boolean" === typeof mixedRef ? convertStringRefToCallbackRef(returnFiber, current, element, mixedRef) : mixedRef; workInProgress.ref = returnFiber; @@ -5188,11 +5183,18 @@ function deferHiddenOffscreenComponent(current, workInProgress, nextBaseLanes) { } function markRef(current, workInProgress) { var ref = workInProgress.ref; - if ( - (null === current && null !== ref) || - (null !== current && current.ref !== ref) - ) - (workInProgress.flags |= 512), (workInProgress.flags |= 2097152); + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } function updateFunctionComponent( current, @@ -9923,7 +9925,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1128 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-bdd9cd5c", + version: "18.3.0-canary-06f130e8", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9966,7 +9968,7 @@ var internals$jscomp$inline_1367 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-bdd9cd5c" + reconcilerVersion: "18.3.0-canary-06f130e8" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1368 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 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 256a22c40f..e3472042d5 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<> + * @generated SignedSource<<2ac537308632647a4cb69db0af181ea0>> */ "use strict"; @@ -3080,24 +3080,19 @@ function convertStringRefToCallbackRef( var refs = inst.refs; null === value ? delete refs[stringRef] : (refs[stringRef] = value); } + var stringRef = "" + mixedRef; returnFiber = element._owner; - if (!returnFiber) { - if ("string" !== typeof mixedRef) - throw Error( - "Expected ref to be a function, a string, an object returned by React.createRef(), or null." - ); + if (!returnFiber) throw Error( "Element ref was specified as a string (" + - mixedRef + + 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://reactjs.org/link/refs-must-have-owner for more information." ); - } if (1 !== returnFiber.tag) throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ); - var stringRef = "" + mixedRef, - inst = returnFiber.stateNode; + var inst = returnFiber.stateNode; if (!inst) throw Error( "Missing owner for string ref " + @@ -3117,9 +3112,9 @@ function convertStringRefToCallbackRef( function coerceRef(returnFiber, current, workInProgress, element) { var mixedRef = element.ref; returnFiber = - null !== mixedRef && - "function" !== typeof mixedRef && - "object" !== typeof mixedRef + "string" === typeof mixedRef || + "number" === typeof mixedRef || + "boolean" === typeof mixedRef ? convertStringRefToCallbackRef(returnFiber, current, element, mixedRef) : mixedRef; workInProgress.ref = returnFiber; @@ -5384,11 +5379,18 @@ function deferHiddenOffscreenComponent(current, workInProgress, nextBaseLanes) { } function markRef(current, workInProgress) { var ref = workInProgress.ref; - if ( - (null === current && null !== ref) || - (null !== current && current.ref !== ref) - ) - (workInProgress.flags |= 512), (workInProgress.flags |= 2097152); + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } function updateFunctionComponent( current, @@ -10625,7 +10627,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1206 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-f7ec4633", + version: "18.3.0-canary-bd69fbf0", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10681,7 +10683,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-f7ec4633" + reconcilerVersion: "18.3.0-canary-bd69fbf0" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {