react-dom package contains methods that are only supported for the web applications (which run in the browser DOM environment). They are not supported for React Native.
These APIs can be imported from your components. They are rarely used:
createPortallets you render child components in a different part of the DOM tree.
flushSynclets you force React to flush a state update and update the DOM synchronously.
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.
react-dom package provides two additional entry points:
react-dom/clientcontains APIs to render React components on the client (in the browser).
react-dom/servercontains APIs to render React components on the server.
These APIs will be removed in a future major version of React.
findDOMNodefinds the closest DOM node corresponding to a class component instance.
hydratemounts a tree into the DOM created from server HTML. Deprecated in favor of
rendermounts a tree into the DOM. Deprecated in favor of
unmountComponentAtNodeunmounts a tree from the DOM. Deprecated in favor of