InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

React FAQ

  • JSXTransformer vs babel
  • React.render vs ReactDOM.render
  • React.DOM factory methods
  • Error - Adjacent JSX elements must be wrapped
 
  • Home
  • > Tutorials
  • > Javascript
  • > React
  • > React FAQ

React.render vs ReactDOM.render – which one should be used?

on Feb 11, 2016

Question: I see some React tutorials using React.render and some using ReactDOM.render. Which one should be used?

React introduced react-dom package in version 0.14 which has ReactDOM.render. It is better to use ReactDOM for new code. Here is sample usage.

// include react.js and react-dom.js
<script type="text/babel">
ReactDOM.render(
  <h1>Hello world</h1>,
  document.getElementById('hello')
);
</script>

Suggested posts:

  1. Python xrange examples
  2. jquery ajax – post form having file uploads
  3. PHP array map example
  4. React basic clock example using setInterval
  5. CSS transform – skew (skewX and skewY)
  6. Comic strip – Startup and losses
  7. React jsx hello world with offline transformation
  8. React javascript render hello world
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged React FAQ, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress