Renders a TextEditor bound to react-hook-form, for the forms that take a Markdown text (a dump's note, a playlist's description).
f
RichTextField<T extends FieldValues>(unnamed 0: RichTextFieldProps<T>): React.JSX.Element
Renders the editor with its label and the field's error. It must sit under a
react-hook-form FormProvider, such as one given useApiForm's result.
I
RichTextFieldProps
Passed to RichTextField by a form that holds a string field.
- autoResize: boolean
- disabled: boolean
-
editorRef: React.Ref<TextEditorHandle>
The editor's ref, for a caller that focuses it.
- label: string
-
maxLength: number
Counted in the editor and checked on submit, with a message. It overrides a
maxLengthinrules. - name: Path<T>
-
onSubmit: () => void
Called on Ctrl/Cmd+Enter.
- placeholder: string
- rows: number
- rules: RegisterOptions<T, Path<T>>
Usage
import * as mod from "src/components/form/RichTextField.tsx";