dillon1000/react

Commit

Fix double preload (#26729)

I found a couple scenarios where preloads were issued too aggressively

1. During SSR, if you render a new stylesheet after the preamble flushed
it will flush a preload even if the resource was already preloaded
2. During Client render, if you call `ReactDOM.preload()` it will only
check if a preload exists in the Document before inserting a new one. It
should check for an underlying resource such as a stylesheet link or
script if the preload is for a recognized asset type
Browse files
Changed paths3 files
First-parent comparison
M packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js ModifiedM packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js ModifiedM packages/react-dom/src/__tests__/ReactDOMFloat-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…