-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor becomes unresponsive when content is long #200
Comments
react-markdown-editor/src/index.tsx Lines 192 to 198 in 2d3f450
@tnhu This is due to the rendering of long text by |
@jaywcjlove I pass |
@tnhu Quick speed boost if you render custom <MarkdownEditor
height={300}
value={markdown}
+ renderPreview={() => <div />}
/> |
To improve performance, is it possible to disable renderPreview completely while preview section is not visible? |
import React from 'react';
import MarkdownEditor from '@uiw/react-markdown-editor';
const mdStr = `# This is a H1 \n## This is a H2 \n###### This is a H6`;
const Dome = () => {
return (
<MarkdownEditor
value={mdStr}
+ renderPreview={() => null}
onChange={(value, viewUpdate) => {
}}
/>
)
}; |
🤦♂️ thanks 😄🙏 |
Try on https://uiwjs.github.io/react-markdown-editor/ with a very long document (Let's say you duplicate the content until it reaches 1000 lines), the editor becomes slower and slower. If you double or triple the lines, it becomes very unresponsive. Type something and it shows up after some seconds.
I tested the same contents on https://codemirror.net/try/?example=Markdown%20code%20block%20highlighting. It does not have the same problem. I guess the issue stays in this library's implementation.
Note that I tested with Preview OFF, plus under an incognito Chrome window.
The text was updated successfully, but these errors were encountered: