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

chore(next/image): update priority prop docs with loading prop side effect warning #70835

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

Aerilym
Copy link
Contributor

@Aerilym Aerilym commented Oct 6, 2024

What?

Updated the Image priority prop docs section with information about using the priority prop with the loading prop.

Why?

Using these props together can cause an undocumented error:

Error: Image with src "..." has both "priority" and "loading='lazy'" properties. Only one should be used.

The existing documentation made no mention of this, and was unclear about if you could use these props together:

Lazy loading is automatically disabled for images using priority.
This line on its own made it sound like the lazy prop would be disabled automatically. (it is not if you have set it)

How?

Added clarity about what happens when you use lazy and priority and a suggestion to unset lazy when using priority

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Oct 6, 2024
@ijjk
Copy link
Member

ijjk commented Oct 6, 2024

Allow CI Workflow Run

  • approve CI run for commit: eeab8e8

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@Aerilym Aerilym changed the title chore(next/image): addImage priority prop docs with loading prop side effect warning chore(next/image): update priority prop docs with loading prop side effect warning Oct 6, 2024
@leerob leerob merged commit bfecbd4 into vercel:canary Oct 11, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants