React vs ReactDOM?

后端 未结 9 1037
野性不改
野性不改 2020-11-30 18:02

I\'m a bit new to react. I see we have to import two things to get started, React and ReactDOM, can anyone explain the difference. I\'m reading thr

9条回答
  •  长情又很酷
    2020-11-30 18:21

    React: React is a javascript library, designed for building better user interfaces.

    React-DOM: React-DOM is a complimentary library to React which glues React to the browser DOM

    We’re using React and whenever we use methods like render() or findDOMNode() we’re using React-DOM.

    As we look at packages like react-native, react-art, react-canvas, and react-three, it's become clear that the beauty and essence of React has nothing to do with browsers or the DOM. To make this more clear and to make it easier to build more environments that React can render to, they splitting the main react package into two: react and react-dom.

提交回复
热议问题