# react-dom

<div class="WaaZC" id="bkmrk-react-dom-is-a-core-"><div class="rPeykc" data-hveid="CDcQAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQINxAB"><span data-huuid="15962349409372647396">`react-dom` is a core package within the React ecosystem, specifically designed for web applications that run in the browser's Document Object Model (DOM) environment. </span><span data-huuid="15962349409372647177">It provides the necessary methods and functionalities to interact with and manipulate the DOM, enabling React to efficiently render and manage web page elements. </span></div></div><div class="rPeykc" data-hveid="CDcQAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQINxAB" id="bkmrk-"></div><div class="rPeykc" data-hveid="CDcQAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQINxAB" id="bkmrk--1"></div><div class="WaaZC" id="bkmrk--2"><div class="rPeykc" data-hveid="CDcQAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQINxAB">  
</div></div><div class="WaaZC" id="bkmrk-key-aspects-of-react"><div aria-level="3" class="rPeykc pyPiTc" data-hveid="CC8QAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQILxAB" role="heading">**<span data-huuid="15962349409372646739">Key aspects of `react-dom`: </span>**</div><div aria-level="3" class="rPeykc pyPiTc" data-hveid="CC8QAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQILxAB" role="heading"></div></div><div class="WaaZC" id="bkmrk-dom-specific-methods">- <div class="zMgcWd dSKvsb" data-il=""><div data-crb-p=""><div class="xFTqob"><div class="Gur8Ad" style="display: inline;"><span data-huuid="15962349409372646082">**DOM-specific methods:** </span></div><div class="vM0jzc" style="display: inline;"><span data-huuid="15962349409372645863">It offers methods like `createRoot` (from `react-dom/client` in React 18+) for initializing a React application by attaching it to a root DOM element, and `render` (used on the `root` object) to render React elements into the DOM. </span></div></div></div></div>

<div class="bsmXxe" id="bkmrk-client-apis%3A-the-rea" role="none"><div class="zMgcWd dSKvsb" data-il=""><div data-crb-p=""><div class="xFTqob"><div class="Gur8Ad" style="display: inline;">- <span data-huuid="15962349409372645425">**Client APIs:** </span><div class="vM0jzc" style="display: inline;"><span data-huuid="15962349409372645206">The `react-dom/client` module contains APIs primarily used at the top level of a client-side React application to render components in the browser. </span></div>

</div></div></div></div></div><div class="bsmXxe" id="bkmrk-server-apis%3A-the-rea" role="none"><div class="zMgcWd dSKvsb" data-il=""><div data-crb-p=""><div class="xFTqob"><div class="Gur8Ad" style="display: inline;">- <span data-huuid="15962349409372644768">**Server APIs:** </span><div class="vM0jzc" style="display: inline;"><span data-huuid="15962349409372644549">The `react-dom/server` module provides APIs for rendering React components to HTML strings on the server, a common practice in server-side rendering (SSR) for improved performance and SEO. </span></div>

</div></div></div></div></div><div class="bsmXxe" id="bkmrk-hooks-and-components" role="none"><div class="zMgcWd dSKvsb" data-il=""><div data-crb-p=""><div class="xFTqob"><div class="Gur8Ad" style="display: inline;">- <span data-huuid="15962349409372644111">**Hooks and Components:** </span><div class="vM0jzc" style="display: inline;"><span data-huuid="15962349409372643892">`react-dom` also includes Hooks and components specifically tailored for web applications, such as those related to managing focus, scroll position, or interacting with browser APIs. </span></div>

</div></div></div></div></div><div class="bsmXxe" id="bkmrk-dom-manipulation%3A-wh" role="none"><div class="zMgcWd dSKvsb" data-il=""><div data-crb-p=""><div class="xFTqob"><div class="Gur8Ad" style="display: inline;">- <span data-huuid="15962349409372643454">**DOM Manipulation:** </span><div class="vM0jzc" style="display: inline;"><span data-huuid="15962349409372647331">While React encourages working with its declarative component model, `react-dom` offers escape hatches like `useRef` that allow direct manipulation of the DOM when necessary, for example, to integrate with third-party libraries or handle specific browser interactions. </span></div>

</div></div></div></div></div><div class="bsmXxe" id="bkmrk-hydration%3A-react-dom" role="none"><div class="zMgcWd dSKvsb" data-il=""><div data-crb-p=""><div class="xFTqob"><div class="Gur8Ad" style="display: inline;">- <span data-huuid="15962349409372646893">**Hydration:** </span><div class="vM0jzc" style="display: inline;"><span data-huuid="15962349409372646674">`react-dom` facilitates hydration, the process of attaching event listeners and making a server-rendered HTML page interactive on the client-side. </span></div>

</div></div></div></div></div></div><div class="WaaZC" id="bkmrk-in-essence%2C-react-do"><div class="bsmXxe" id="bkmrk-in-essence%2C-react-do-1" role="none"><div class="rPeykc" data-hveid="CHkQAQ" data-ved="2ahUKEwjwvq6qoLCRAxVqTmwGHV5YGHgQo_EKegQIeRAB"><span data-huuid="9463616492079696546">In essence, `react-dom` serves as the bridge between your React components and the actual web page displayed in the browser, handling the intricate details of DOM management so you can focus on building your application's UI with React's declarative paradigm</span></div></div></div>