mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 21:21:21 +02:00
update docs
This commit is contained in:
@@ -5,7 +5,21 @@ The top-level React component that renders the Slate editor itself.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
<Editor
|
<Editor
|
||||||
|
plugins={Array}
|
||||||
|
state={State}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
The editor takes a `State` instance that contains it's content and selection, and an array of `plugins` that define its behavior.
|
||||||
|
|
||||||
|
In addition to those two properties, the editor allows passing any of the properties that a plugin can define:
|
||||||
|
|
||||||
|
```js
|
||||||
|
<Editor
|
||||||
|
onBeforeInput={Function}
|
||||||
onChange={Function}
|
onChange={Function}
|
||||||
|
onKeyDown={Function}
|
||||||
|
onPaste={Function}
|
||||||
plugins={Array}
|
plugins={Array}
|
||||||
renderDecorations={Function}
|
renderDecorations={Function}
|
||||||
renderMark={Function}
|
renderMark={Function}
|
||||||
@@ -14,9 +28,8 @@ The top-level React component that renders the Slate editor itself.
|
|||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
|
||||||
The editor takes a `State` instance that contains it's content and selection.
|
These properties are actually an implicit plugin defintion. Internally, they are grouped together and turned into a plugin that is given first priority in the plugin stack.
|
||||||
|
|
||||||
Most of the editor's other properties are actually an implicit plugin defintion. Internally they are grouped together and turned into a plugin that is given first priority in the plugin stack.
|
|
||||||
|
|
||||||
#### Properties
|
#### Properties
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user