-
Notifications
You must be signed in to change notification settings - Fork 47k
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 support for preload media to ReactDOM #28635
Conversation
614dea8
to
e8bcaa8
Compare
e8bcaa8
to
281a48c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY
This PR adds support for `media` option to `ReactDOM.preload()`, which is needed when images differ between screen sizes (for example mobile vs desktop)
This feature is still not available for react-dom 18.3.1. Will it be part of the 19's updates? |
These new APIs are part of the React 19 release and will not be available on any 18.x release. React 19 was originally intended to be released shortly after React conf but we decided to include a change to sibling rendering which has not landed yet but should soon |
Can we have this released in 18? It's a fully backward compatible change |
Summary
This PR adds support for
media
option toReactDOM.preload()
, which is needed when images differ between screen sizes (for example mobile vs desktop).Tests copied from #27129 (thanks @damnsamn!)
How did you test this change?
Ran the tests from #27129 before:
After: