Skip to content
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

When the document is large, the rendering is very sluggish and cannot slide #524

Open
cosoc opened this issue May 19, 2023 · 1 comment
Open

Comments

@cosoc
Copy link

cosoc commented May 19, 2023

When the document is large, the rendering is very sluggish and cannot slide

My com

import MDEditor, { ContextStore } from "@uiw/react-md-editor";
import { ChangeEvent } from "react";

export interface MDEditorInputProps {
  value?: string,
  onChange?: any,
  onHandleHanle?: (value?: string | undefined, event?: ChangeEvent<HTMLTextAreaElement> | undefined, state?: ContextStore | undefined) => void
}

const MDEditorInput = (props: MDEditorInputProps)=> {
  const { value,onHandleHanle,onChange }  = props;

  
  const onChangeT = (value: string | undefined) => {
    onChange(value);
    if (onHandleHanle) {
      onHandleHanle(value);
    }
  }


  return (
    <div>
      <MDEditor
        value={value}
        onChange={onChangeT}
      />
    </div>
  );
}

export default MDEditorInput;

Test data :

react-md-editor home data

react-md-editor version

    "@uiw/react-md-editor": "^3.20.8",

react dev tool

image

@jaywcjlove
Copy link
Member

@cosoc

It will be better to close the editing area and highlight the code, because there is no way to do lazy loading, so it is not suitable for large text loading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants