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

Add fetchpriority="high" when next/image has priority prop 📷 #43096

Conversation

sanjaiyan-dev
Copy link
Contributor

Adding fetchpriority="high" according to priority prop.

Inspired from Angular Image component.

Sorry if I made any mistakes :(

@sanjaiyan-dev
Copy link
Contributor Author

Updated version of #40887

@sanjaiyan-dev
Copy link
Contributor Author

Extremely sorry please teach me to resolve merge conflict.

@@ -355,6 +355,64 @@ function handleLoading(
})
}

sanjaiyan-image-loading-priority
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bug

height={heightInt}
decoding="async"
// https://web.dev/priority-hints/#increase-the-priority-of-the-lcp-image
fetchPriority={priority ? "high" : rest.fetchPriority}
Copy link
Member

@styfle styfle Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will print an warning with React

facebook/react#25682

@ijjk ijjk closed this in #47222 Mar 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants