React DOM API'leri
react-dom paketi, sadece tarayıcı DOM ortamında çalışan web uygulamaları için desteklenen yöntemleri içerir. React Native için desteklenmezler.
API’ler
Bu API’ler bileşenlerinizden içe aktarılabilirler. Nadiren kullanılırlar:
createPortalalt bileşenleri DOM ağacındaki farklı bir bölüme render etmenizi sağlar.flushSyncReact’i bir state güncellemesini hemen uygulamaya zorlayarak senkronize şekilde DOM’u güncellemenizi sağlar.
Resource Preloading APIs
These APIs can be used to make apps faster by pre-loading resources such as scripts, stylesheets, and fonts as soon as you know you need them, for example before navigating to another page where the resources will be used.
React-based frameworks frequently handle resource loading for you, so you might not have to call these APIs yourself. Consult your framework’s documentation for details.
prefetchDNSlets you prefetch the IP address of a DNS domain name that you expect to connect to.preconnectlets you connect to a server you expect to request resources from, even if you don’t know what resources you’ll need yet.preloadlets you fetch a stylesheet, font, image, or external script that you expect to use.preloadModulelets you fetch an ESM module that you expect to use.preinitlets you fetch and evaluate an external script or fetch and insert a stylesheet.preinitModulelets you fetch and evaluate an ESM module.
Giriş noktaları
react-dom paketi iki ek giriş noktası sağlar:
react-dom/clientReact bileşenlerini istemcide (tarayıcıda) render etmek için API’ler içerir.react-dom/serverReact bileşenlerini sunucuda oluşturmak için API’ler içerir.
Kullanımdan kaldırılmış API’ler
findDOMNodebir sınıf bileşeni öğesine karşılık gelen en yakın DOM düğümünü bulur.hydratesunucu HTML’inden oluşturulan DOM’a bir ağaç bağlar.hydrateRootile değiştirilmiştir.renderbir ağacı DOM’a bağlar.createRootile değiştirilmiştir.unmountComponentAtNodebir ağacı DOM’dan kaldırır.root.unmount()ile değiştirilmiştir.