mirror of
https://github.com/jakobkordez/s5_practice.git
synced 2025-05-15 16:20:31 +00:00
16 lines
320 B
TypeScript
16 lines
320 B
TypeScript
import 'katex/dist/katex.min.css';
|
|
import KaTeX from 'katex';
|
|
import { memo } from 'react';
|
|
|
|
interface TeXProps {
|
|
math: string;
|
|
}
|
|
|
|
export default memo(TeX);
|
|
|
|
export function TeX({ math }: TeXProps) {
|
|
const innerHtml = KaTeX.renderToString(math);
|
|
|
|
return <span dangerouslySetInnerHTML={{ __html: innerHtml }} />;
|
|
}
|