react json object pretty

JavaScript
var jsonObject = JSON.parse( jsonString ) // parse to object if necessary

<div>
  <pre> // defines preformatted text
  	{ JSON.stringify( jsonObject, null, 2 ) } // spacing level = 2
  </pre>
</div>
Source

Also in JavaScript: