correctly get string from children

This commit is contained in:
Nate Sesti 2023-06-18 18:57:51 -07:00
parent 93c7f35759
commit f403bbe26b

View file

@ -2,13 +2,13 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { synthwave84 } from "react-syntax-highlighter/dist/esm/styles/prism";
interface StyledCodeProps {
children: string;
children: string;
}
const StyledCode = (props: (StyledCodeProps)) => (
const StyledCode = (props: StyledCodeProps) => (
<SyntaxHighlighter style={synthwave84}>
{props.children}
{(props.children as any).props.children}
</SyntaxHighlighter>
);
export default StyledCode;
export default StyledCode;