React DOM APIs

The 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. react-dom 패키지에는 웹 애플리케이션(브라우저 DOM 환경에서 실행되는)에만 지원되는 메서드가 포함되어 있습니다. 이 메서드들은 React Native에서는 지원되지 않습니다.


APIs

These APIs can be imported from your components. They are rarely used: 컴포넌트에서 다음 API들을 사용할 수 있습니다. 자주 사용되지는 않습니다:

  • createPortal lets you render child components in a different part of the DOM tree. createPortal을 사용하면 DOM 트리의 다른 부분에 자식 컴포넌트를 렌더링할 수 있습니다.

  • flushSync lets you force React to flush a state update and update the DOM synchronously. flushSync를 사용하면 React가 state 업데이트를 강제로 플러시(메모리등을 강제로 처리하여 비워냄)하고 DOM을 동기적으로 업데이트할 수 있습니다.

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.

  • prefetchDNS lets you prefetch the IP address of a DNS domain name that you expect to connect to.
  • preconnect lets you connect to a server you expect to request resources from, even if you don’t know what resources you’ll need yet.
  • preload lets you fetch a stylesheet, font, image, or external script that you expect to use.
  • preloadModule lets you fetch an ESM module that you expect to use.
  • preinit lets you fetch and evaluate an external script or fetch and insert a stylesheet.
  • preinitModule lets you fetch and evaluate an ESM module.

Entry points 진입점

The react-dom package provides two additional entry points: React DOM 패키지는 두 개의 추가 진입점을 제공합니다:

  • react-dom/client contains APIs to render React components on the client (in the browser). react-dom/client 에는 클라이언트(브라우저)에서 React 컴포넌트를 렌더링하기 위한 API가 포함되어 있습니다.

  • react-dom/server contains APIs to render React components on the server. react-dom/server 에는 서버에서 React 컴포넌트를 렌더링하기 위한 API가 포함되어 있습니다.


Deprecated APIs 지원 중단된 API들

Deprecated | 지원 중단

These APIs will be removed in a future major version of React. 다음 API들은 향후 React의 메인 버전에서 삭제될 예정입니다.

  • findDOMNode finds the closest DOM node corresponding to a class component instance. findDOMNode는 클래스 컴포넌트 인스턴스에 해당하는 가장 가까운 DOM 노드를 찾습니다.

  • hydrate mounts a tree into the DOM created from server HTML. Deprecated in favor of hydrateRoot. hydrate는 서버 HTML에서 생성된 DOM에 트리를 마운트합니다. hydrateRoot로 대체되어 지원 중단되었습니다.

  • render mounts a tree into the DOM. Deprecated in favor of createRoot. render는 트리를 DOM에 마운트합니다. createRoot로 대체되어 지원 중단되었습니다.

  • unmountComponentAtNode unmounts a tree from the DOM. Deprecated in favor of root.unmount(). unmountComponentAtNode 는 DOM에서 트리를 언마운트합니다. root.unmount()로 대체되어 지원 중단되었습니다.