Use Memo on markdown-preview component to avoid re-render

This commit is contained in:
Rafael 2021-12-31 09:28:29 -03:00 committed by Thomas Zarebczan
parent f568f97e5e
commit 2c8ad2b89a

View file

@ -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 {
content,
strip,
@ -255,6 +255,4 @@ const MarkdownPreview = (props: MarkdownProps) => {
}
</div>
);
};
export default MarkdownPreview;
});