Skip to content

Bug: fetchPriority is not available in ReactDOM.preloadModule() #36834

Closed

Description

@TheAlexLichter

ReactDOM.preload() supports a fetchPriority option, but ReactDOM.preloadModule() currently ignores
it, ruling out more granular preload optimization for ESM-based apps.

Details

Frameworks using native ES modules rely on modulepreload to discover client-side JavaScript
during server rendering. By default, these get a high priority in browsers.

When a page emits many JS files, they may compete with render-critical resources.

React already fixes this for bootstrap modules via fetchPriority="low" and also It also supports explicit priorities through ReactDOM.preload() and ReactDOM.preinit() but not via ReactDOM.preloadModule().

This would enable the optimization so @vitejs/plugin-rsc and others can pass fetchPriority: 'low' further down (see vitejs/vite-plugin-react#1264).

Proposed Addition

Extend PreloadModuleOptions with fetchPriority and forward this value to the generated link.

type PreloadModuleOptions = {
  as?: string
  crossOrigin?: string
  integrity?: string
  nonce?: string
  fetchPriority?: 'high' | 'low' | 'auto'
}

The same option may also make sense for ReactDOM.preinitModule().

Alternatives

Developers could:

  • Rewrite React’s streamed HTML (exhausting and brittle)
  • Emit separate preload hints (risking duplication)
  • Avoid early module discovery entirely (not performant)

(Somewhat) related work

Activity

  1. added
    Status: Unconfirmed
    on Jun 21, 2026
  2. ankushhh28 commented on Jun 24, 2026

    @ankushhh28

    @TheAlexLichter I'd like to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Unconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions