1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 09:13:24 +01:00

Fix slate-react plugin documentation (#2910)

* Re-add removed renderMark
* Fix renderAnnotation & renderDecoration props
This commit is contained in:
Charley DAVID 2019-07-05 13:28:43 -03:00 committed by Ian Storm Taylor
parent 82c9e82d41
commit 7377266b43

View File

@ -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`
`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,
children: ReactNode,
editor: Editor,
mark: Mark,
decoration: Decoration,
marks: Set<Mark>,
node: Node,
offset: Number,
@ -157,7 +178,7 @@ Render an `Annotation` with `props`. The `props` object contains:
attributes: Object,
children: ReactNode,
editor: Editor,
mark: Mark,
annotation: Annotation,
marks: Set<Mark>,
node: Node,
offset: Number,