diff --git a/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js b/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js index 94698a8d527a9..1149e442f98ea 100644 --- a/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js +++ b/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js @@ -2284,6 +2284,7 @@ function preloadPropsFromPreloadOptions( fetchPriority: options.fetchPriority, imageSrcSet: options.imageSrcSet, imageSizes: options.imageSizes, + referrerPolicy: options.referrerPolicy, }; } diff --git a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js index b6e1e90507d5b..ec7d829428731 100644 --- a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js +++ b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js @@ -5564,6 +5564,7 @@ function preloadPropsFromPreloadOptions( fetchPriority: options.fetchPriority, imageSrcSet: options.imageSrcSet, imageSizes: options.imageSizes, + referrerPolicy: options.referrerPolicy, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMFloat-test.js b/packages/react-dom/src/__tests__/ReactDOMFloat-test.js index 3a893c616e14a..2ee581f850689 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFloat-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFloat-test.js @@ -3686,6 +3686,91 @@ body { ); }); + it('should handle referrerPolicy on image preload', async () => { + function App({isClient}) { + ReactDOM.preload('/server', { + as: 'image', + imageSrcSet: '/server', + imageSizes: '100vw', + referrerPolicy: 'no-referrer', + }); + + if (isClient) { + ReactDOM.preload('/client', { + as: 'image', + imageSrcSet: '/client', + imageSizes: '100vw', + referrerPolicy: 'no-referrer', + }); + } + + return ( + +
hello + + ); + } + + await act(() => { + renderToPipeableStream(