What's the difference between React and ReactDOM?

Question

What’s the difference between React and ReactDOM?

Answer

React is a JavaScript library for building User Interfaces and ReactDOM is the JavaScript library that allows React to interact with the DOM.

11 Likes

I thought its an environment within react library that can interpret jsx into dom element

Think again.

7 Likes

As the name implies, ReactDOM is the glue between React and the DOM. For everything else, there’s React. You use React to define and create your elements, for lifecycle hooks, etc. i.e. the guts of a React application.

So, in brief:

  • React: a javascript library, designed for building user interfaces
  • React-DOM: a complimentary library to React which glues React to the browser DOM
25 Likes

I had the same perception

absolutely l agree react is JS library and React DOM is utility web app

Okay React is used for building the UI
And ReactDOM is used for maintaining the DOM
Makes sense

React is the js library for creating user interfaces, while i like to think of ReactDom as the virtual house that allows us to connect to the DOM virtually, correct me if I’m wrong :joy::palms_up_together:t4: