diff --git a/packages/react/src/jsx/ReactJSXElement.js b/packages/react/src/jsx/ReactJSXElement.js index b429db3326b5e..9b83632b5da75 100644 --- a/packages/react/src/jsx/ReactJSXElement.js +++ b/packages/react/src/jsx/ReactJSXElement.js @@ -870,7 +870,12 @@ export function cloneElement(element, config, children) { // Silently steal the ref from the parent. ref = config.ref; if (!disableStringRefs) { - ref = coerceStringRef(ref, owner, element.type); + let refOwner = owner; + if (refOwner == null) { + // fall back to the current owner + refOwner = ReactSharedInternals.owner; + } + ref = coerceStringRef(ref, refOwner, element.type); } } owner = ReactSharedInternals.owner;