mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 02:49:56 +02:00
Fix slate-react plugin documentation (#2910)
* Re-add removed renderMark * Fix renderAnnotation & renderDecoration props
This commit is contained in:
committed by
Ian Storm Taylor
parent
82c9e82d41
commit
7377266b43
@@ -125,6 +125,27 @@ renderEditor: (props, editor, next) => {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `renderMark`
|
||||||
|
|
||||||
|
`Function renderMark(props: Object, editor: Editor, next: Function) => ReactNode|Void`
|
||||||
|
|
||||||
|
Render a `Mark` with `props`. The `props` object contains:
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
attributes: Object,
|
||||||
|
children: ReactNode,
|
||||||
|
editor: Editor,
|
||||||
|
mark: Mark,
|
||||||
|
marks: Set<Mark>,
|
||||||
|
node: Node,
|
||||||
|
offset: Number,
|
||||||
|
text: String,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You must spread the `props.attributes` onto the top-level DOM node you use to render the mark.
|
||||||
|
|
||||||
### `renderDecoration`
|
### `renderDecoration`
|
||||||
|
|
||||||
`Function renderDecoration(props: Object, editor: Editor, next: Function) => ReactNode|Void`
|
`Function renderDecoration(props: Object, editor: Editor, next: Function) => ReactNode|Void`
|
||||||
@@ -136,7 +157,7 @@ Render a `Decoration` with `props`. The `props` object contains:
|
|||||||
attributes: Object,
|
attributes: Object,
|
||||||
children: ReactNode,
|
children: ReactNode,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
mark: Mark,
|
decoration: Decoration,
|
||||||
marks: Set<Mark>,
|
marks: Set<Mark>,
|
||||||
node: Node,
|
node: Node,
|
||||||
offset: Number,
|
offset: Number,
|
||||||
@@ -157,7 +178,7 @@ Render an `Annotation` with `props`. The `props` object contains:
|
|||||||
attributes: Object,
|
attributes: Object,
|
||||||
children: ReactNode,
|
children: ReactNode,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
mark: Mark,
|
annotation: Annotation,
|
||||||
marks: Set<Mark>,
|
marks: Set<Mark>,
|
||||||
node: Node,
|
node: Node,
|
||||||
offset: Number,
|
offset: Number,
|
||||||
|
Reference in New Issue
Block a user