Use Memo on markdown-preview component to avoid re-render
This commit is contained in:
parent
f568f97e5e
commit
2c8ad2b89a
1 changed files with 2 additions and 4 deletions
|
@ -143,7 +143,7 @@ const REPLACE_REGEX = /(<iframe\s+src=["'])(.*?(?=))(["']\s*><\/iframe>)/g;
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
|
|
||||||
const MarkdownPreview = (props: MarkdownProps) => {
|
export default React.memo<MarkdownProps>(function MarkdownPreview(props: MarkdownProps) {
|
||||||
const {
|
const {
|
||||||
content,
|
content,
|
||||||
strip,
|
strip,
|
||||||
|
@ -255,6 +255,4 @@ const MarkdownPreview = (props: MarkdownProps) => {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
export default MarkdownPreview;
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue