1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 02:49:56 +02:00

update docs

This commit is contained in:
Ian Storm Taylor
2016-07-11 13:19:39 -07:00
parent e4578d384f
commit b2a94d7efb

View File

@@ -0,0 +1,32 @@
### `<Editor>`
The top-level React component that renders the Slate editor itself.
```js
<Editor
onChange={Function}
plugins={Array}
renderDecorations={Function}
renderMark={Function}
renderNode={Function}
state={State}
/>
```
The editor takes a `State` instance that contains it's content and selection.
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
#### `onChange(state, editor)`
A handler that's called every time the editor's state changes. It is called with the newly changed `state` and the `editor` instance itself.
#### Methods
#### `getState()`
Return the editor's current internal state.