v5.0.0
Documentation v5.0.0: https://raw.githack.com/uiwjs/react-markdown-editor/35380f4/index.html
Comparing Changes: v4.0.3...v5.0.0
npm i @uiw/react-markdown-editor@5.0.0
- 🌟 feat: Update
codemirror 6
. 73a7643 @jaywcjlove - 💄 chore: update workflow config. 878f4c3 @jaywcjlove
import MarkdownEditor from '@uiw/react-markdown-editor';
const code = 'console.log("hello world!");';
<MarkdownEditor
value={code}
- onChange={(editor, data, value) => setMarkdown(value)}
+ onChange={(value, viewUpdate) => setMarkdown(value)}
- options={{ }}
+ extensions={[
+ ]}
/>
- export type ButtonHandle = (command: ICommand, props: IMarkdownEditor, options: {
- preview?: HTMLDivElement | null,
- container?: HTMLDivElement | null,
- containerEditor?: HTMLDivElement | null;
- editor?: Editor;
- }) => JSX.Element
+ export type ButtonHandle = (command: ICommand, props: IMarkdownEditor, options: ToolBarProps) => JSX.Element;
export type ICommand = {
icon?: React.ReactElement;
name?: string;
keyCommand?: string;
button?: ButtonHandle | React.ButtonHTMLAttributes<HTMLButtonElement>;
+ execute?: (editor: ReactCodeMirrorRef) => void;
- execute?: (editor: Editor, selection: string, position: Position, opts: {
- preview?: HTMLDivElement | null,
- container?: HTMLDivElement | null,
- }) => void;
}