title: How do I display prettyprinted JSON in a React component?
body: <p>I have this ES6 React component:</p>
  
  <pre><code>class KeyDetails extends React.Component {
  
      render() {
          return (
              &lt;p className="layout__item u-1/2-lap-and-up"&gt;
                  {JSON.stringify(this.props.details, null, 2)}
              &lt;/p&gt;
          )
      }
  }
  </code></pre>
  
  <p>But all of the newlines and quotation marks appear encoded.</p>
  
  <p><a href="https://i.stack.imgur.com/dHM54.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dHM54.png" alt="enter image description here"></a></p>
  
  <p>How can I display raw, nicely formatted text via React?</p>