refactor: type improvement of file MarkdownBlock.tsx (#2854)
This commit is contained in:
1 parent
dace684afa
commit
0dabb06cb2
1 file changed
+2
-1
@@ -1,4 +1,5 @@
|
||||
import React, { memo, useEffect } from "react"
|
||||
import type { ComponentProps } from "react"
|
||||
import { useRemark } from "react-remark"
|
||||
import rehypeHighlight, { Options } from "rehype-highlight"
|
||||
import styled from "styled-components"
|
||||
@@ -234,7 +235,7 @@ const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => {
|
||||
</StyledPre>
|
||||
)
|
||||
},
|
||||
code: (props: any) => {
|
||||
code: (props: ComponentProps<"code">) => {
|
||||
const className = props.className || ""
|
||||
if (className.includes("language-mermaid")) {
|
||||
const codeText = String(props.children || "")
|
||||
|
||||
Reference in new issue
Block a user