Skip to content

Bug: <img fetchPriority> attribute is not supported #25682

Closed
@iamakulov

Description

@iamakulov

React version: 18.0.0

Steps To Reproduce

  1. Render an <img src="#" fetchPriority="high" /> tag

Link to code example: https://playcode.io/1011424

The current behavior

A warning is logged:

Warning: React does not recognize the `fetchPriority` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `fetchpriority` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    at img
    at div
    at App

The expected behavior

React should recognize the fetchPriority prop and emit it as fetchpriority into HTML.

To be clear, using <img fetchpriority="high"> works and doesn’t log a warning. However, it is inconsistent with other DOM APIs. In the JS DOM API, the attribute is camel-cased as HTMLImageElement.fetchPriority.

fetchPriority has been supported in Chromium browsers since Chromium 101 (Apr 26, 2022). Per Patrick Meenan, Mozilla is working on an implementation as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions