correctly get string from children
This commit is contained in:
parent
93c7f35759
commit
f403bbe26b
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue