Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ReactDOM.preload() #27200

Closed
styfle opened this issue Aug 7, 2023 · 0 comments · Fixed by #27201
Closed

Bug: ReactDOM.preload() #27200

styfle opened this issue Aug 7, 2023 · 0 comments · Fixed by #27201
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@styfle
Copy link
Contributor

styfle commented Aug 7, 2023

React version: 18.3.0-canary-9377e1010-20230712

Steps To Reproduce

  1. Add <meta name="viewport" content="width=device-width, initial-scale=1" /> inside of <head>
  2. Call ReactDOM.preload('/img.png', { as: 'image' })

The current behavior

The <link> generated from the preload is before the <meta> for the viewport.

The expected behavior

The <link> should come after the <meta> for the viewport.

Related

cc @gnoff

@styfle styfle added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Aug 7, 2023
gnoff added a commit that referenced this issue Aug 7, 2023
Fixes: #27200 

preloads for images that appear before the viewport meta may be loaded
twice because the proper device image information is not used with the
preload but is with the image itself. The viewport meta should be
emitted earlier than all preloads to avoid this.

this change moves the queue for the viewport meta to preconnects which
already has the right priority for this tag
github-actions bot pushed a commit that referenced this issue Aug 7, 2023
Fixes: #27200

preloads for images that appear before the viewport meta may be loaded
twice because the proper device image information is not used with the
preload but is with the image itself. The viewport meta should be
emitted earlier than all preloads to avoid this.

this change moves the queue for the viewport meta to preconnects which
already has the right priority for this tag

DiffTrain build for [ea17cc1](ea17cc1)
EdisonVan pushed a commit to EdisonVan/react that referenced this issue Apr 15, 2024
Fixes: facebook#27200 

preloads for images that appear before the viewport meta may be loaded
twice because the proper device image information is not used with the
preload but is with the image itself. The viewport meta should be
emitted earlier than all preloads to avoid this.

this change moves the queue for the viewport meta to preconnects which
already has the right priority for this tag
bigfootjon pushed a commit that referenced this issue Apr 18, 2024
Fixes: #27200

preloads for images that appear before the viewport meta may be loaded
twice because the proper device image information is not used with the
preload but is with the image itself. The viewport meta should be
emitted earlier than all preloads to avoid this.

this change moves the queue for the viewport meta to preconnects which
already has the right priority for this tag

DiffTrain build for commit ea17cc1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant