Interface: MDXEditorMethods

The interface for the MDXEditor object reference.

Example

 const mdxEditorRef = React.useRef<MDXEditorMethods>(null)
 <MDXEditor ref={mdxEditorRef} />

Table of contents

Properties

Properties

focus

focus: (callbackFn?: () => void, opts?: { defaultSelection?: "rootStart" | "rootEnd" ; preventScroll?: boolean }) => void

Sets focus on input

Type declaration

▸ (callbackFn?, opts?): void

Sets focus on input

Parameters
NameType
callbackFn?() => void
opts?Object
opts.defaultSelection?"rootStart" | "rootEnd"
opts.preventScroll?boolean
Returns

void


getMarkdown

getMarkdown: () => string

Gets the current markdown value.

Type declaration

▸ (): string

Gets the current markdown value.

Returns

string


insertMarkdown

insertMarkdown: (value: string) => void

Inserts markdown at the current cursor position. Use the focus if necessary.

Type declaration

▸ (value): void

Inserts markdown at the current cursor position. Use the focus if necessary.

Parameters
NameType
valuestring
Returns

void


setMarkdown

setMarkdown: (value: string) => void

Updates the markdown value of the editor.

Type declaration

▸ (value): void

Updates the markdown value of the editor.

Parameters
NameType
valuestring
Returns

void