mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
22 lines
581 B
TypeScript
22 lines
581 B
TypeScript
import * as React from "react";
|
|
import SyntaxHighlighter from "react-syntax-highlighter";
|
|
import { docco } from "react-syntax-highlighter/styles/hljs";
|
|
|
|
function highlighter(): JSX.Element {
|
|
const codeString: string = `class CPP {
|
|
private year: number;
|
|
public constructor(private version: string) {
|
|
this.year = Number(version.match(/.+\d+$/));
|
|
}
|
|
public version(): string {
|
|
return this.version;
|
|
}
|
|
}
|
|
`;
|
|
return (
|
|
<SyntaxHighlighter language="javascript" style={docco}>
|
|
{codeString}
|
|
</SyntaxHighlighter>
|
|
);
|
|
}
|