title: How to import highlight.js on react component?
body: <p>I would like to display and highlight some "JSON" data in a React.js component.</p>
  
  <p>It works, but the problem is when the component refresh, the highlighted code disappear. </p>
  
  <p>I want to clarify that I'm a newbie here.</p>
  
  <p>Thank you for your support.</p>
  
  <pre><code>import React from "react";
  
  import hljs from "highlight.js";
  import "highlight.js/styles/github.css";
  import json from "highlight.js/lib/languages/json";
  hljs.registerLanguage("json", json);
  hljs.initHighlightingOnLoad();
  
  const JsonViewer = props =&gt; {
    return (
      &lt;pre&gt;
        &lt;code className="json"&gt;
           {JSON.stringify(props.content, null, 2)}
        &lt;/code&gt;
      &lt;/pre&gt;
    );
  };
  
  export default JsonViewer;
  </code></pre>