React · Senior · Question 46 of 75
What are the preload and preinit APIs from react-dom in React 19 for?
- ✓Correct answer: To hint the browser in advance to load fonts, styles and scripts
- 2To preload data for
useQuerybefore the component renders - 3To warm up the Server Components cache at build time
Explanation
preload(href, { as: 'font' }), preinit(href, { as: 'style' }), prefetchDNS and preconnect can be called from components and during SSR - React inserts the matching <link>s into <head> and deduplicates them. This speeds up discovery of critical resources.