Reputation: 1
Today I'm done with my hello world example with ReactJS,
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
Above two CDN's included, Just wants to know, what is the difference between them, why do we need to include them, what is the purpose?
Upvotes: 0
Views: 86
Reputation: 6176
They're meant for detaching the actual logic and processing that React does, from the DOM interaction. react-dom
is simply used for rendering react
components into the DOM, finding DOM elements so that React can interact with them. ReactDOM actually only serves us three methods:
findDOMNode
, which finds a DOM node from fx. a React refrender
which renders a React component at a specific place in the DOM, andunmountComponentAtNode
which does the opposite of render
(removes it)Upvotes: 2