Download the code here or install the package
npm install --save react-js-highlight
yarn add react-js-highlight
import React from "react";
import useHighlight from "react-js-highlight";
const App = () => {
return (
<div className="App">
{useHighlight('console.log("hello world")', {
normalColor: "#idkidk",
stringColor: "#idkidk",
classColor: "#idkidk",
keywordColor: "#idkidk",
varColor: "#idkidk",
propertyColor: "#idkidk",
})}
</div>
);
};
^I did not test TypeScript since I am lazy