MCPcopy Index your code
hub / github.com/adobe/react-spectrum / preloadImage

Function preloadImage

packages/dev/s2-docs/src/ComponentCard.tsx:378–388  ·  view source on GitHub ↗
(light: string, dark: string)

Source from the content-addressed store, hash-verified

376};
377
378function preloadImage(light: string, dark: string) {
379 preload(light, {
380 as: 'image',
381 media: '(prefers-color-scheme: light)'
382 });
383
384 preload(dark, {
385 as: 'image',
386 media: '(prefers-color-scheme: dark)'
387 });
388}
389
390export function preloadComponentImages(names: string[]) {
391 for (let key of names) {

Callers 1

preloadComponentImagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected