InterviewHubPRO
Section Overview
Q61

Question 61 of 445

Part 1: Core React, JSX & Component Architecture (1 - 77)

14%
React & Modern Frontend (445 Qs)•Part 1: Core React, JSX & Component Architecture (1 - 77)

Why ReactDOM is separated from React?

The React team worked on extracting all DOM-related features into a separate library called ReactDOM. React v0.14 is the first release in which the libraries are split. By looking at some of the packages, react-native, react-art, react-canvas, and react-three, it has become clear that the beauty and essence of React has nothing to do with browsers or the DOM.

To build more environments that React can render to, React team planned to split the main React package into two: react and react-dom. This paves the way to writing components that can be shared between the web version of React and React Native.

Practical Code Example

javascript
// Separation allows React core to target multiple platforms (Web, Mobile, VR, Terminal):
// react + react-dom = Web Apps
// react + react-native = Mobile Apps
// react + ink = CLI Terminal Apps