See the demo here.
Install qp-react-highlight.js using NPM:
npm install qp-react-highlight.js --save
And then use qp-react-highlight.js to display your text like so:
import Highlight from 'qp-react-highlight.js';
<Highlight language={language}>
{content}
</Highlight>
qp-react-highlight.js is available under the MIT License.