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

Hi guys, is there a wat to change @uiw/react-markdown-preview with a custom one? #429

Closed
jaywcjlove opened this issue Aug 25, 2022 · 1 comment

Comments

@jaywcjlove
Copy link
Member

Hi guys, is there a wat to change @uiw/react-markdown-preview with a custom one? I need to replace the preview component, but I haven't been able to make it work yet. What do you guys suggest?

Originally posted by @EnzoVezzaro in #108 (comment)

@jaywcjlove
Copy link
Member Author

Upgrade v3.17.2

import React from "react";
import MDEditor from '@uiw/react-md-editor';

export default function App() {
  const [value, setValue] = React.useState("**Hello world!!!**");
  return (
    <div className="container">
      <MDEditor
        value={value}
        onChange={setValue}
        components={{
+          preview: (source, state, dispath) => {
+            return <div>......</div>
+          }
        }}
      />
    </div>
  );
}

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

1 participant