File tree Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 1
1
import { Tooltip } from "antd"
2
2
import { CheckIcon , ClipboardIcon } from "lucide-react"
3
- import { FC , memo , useState } from "react"
3
+ import { FC , useState } from "react"
4
4
import { useTranslation } from "react-i18next"
5
5
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"
6
6
import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism"
@@ -10,7 +10,7 @@ interface Props {
10
10
value : string
11
11
}
12
12
13
- export const CodeBlock : FC < Props > = memo ( ( { language, value } ) => {
13
+ export const CodeBlock : FC < Props > = ( { language, value } ) => {
14
14
const [ isBtnPressed , setIsBtnPressed ] = useState ( false )
15
15
const { t } = useTranslation ( "common" )
16
16
return (
@@ -63,4 +63,4 @@ export const CodeBlock: FC<Props> = memo(({ language, value }) => {
63
63
</ div >
64
64
</ >
65
65
)
66
- } )
66
+ }
Original file line number Diff line number Diff line change 1
1
import remarkGfm from "remark-gfm"
2
2
import remarkMath from "remark-math"
3
- import ReactMarkdown , { Options } from "react-markdown"
4
-
3
+ import ReactMarkdown from "react-markdown"
5
4
import "property-information"
6
5
import React from "react"
7
- import { Tooltip } from "antd"
8
- import { CheckIcon , ClipboardIcon } from "lucide-react"
9
- import { useTranslation } from "react-i18next"
10
-
11
- import { FC , memo } from "react"
12
6
import { CodeBlock } from "./CodeBlock"
13
7
14
- export const MemoizedReactMarkdown : FC < Options > = memo (
15
- ReactMarkdown ,
16
- ( prevProps , nextProps ) =>
17
- prevProps . children === nextProps . children &&
18
- prevProps . className === nextProps . className
19
- )
20
8
21
9
export default function Markdown ( { message } : { message : string } ) {
22
10
23
11
return (
24
12
< React . Fragment >
25
- < MemoizedReactMarkdown
13
+ < ReactMarkdown
26
14
className = "prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 dark:prose-dark"
27
15
remarkPlugins = { [ remarkGfm , remarkMath ] }
28
16
components = { {
@@ -55,7 +43,7 @@ export default function Markdown({ message }: { message: string }) {
55
43
}
56
44
} } >
57
45
{ message }
58
- </ MemoizedReactMarkdown >
46
+ </ ReactMarkdown >
59
47
</ React . Fragment >
60
48
)
61
49
}
You can’t perform that action at this time.
0 commit comments