mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 14:11:35 +02:00
docs: clarifies not setting editor values directly & plugin order (#4571)
* Updates "Saving to a Database" example to distinguish actual content changes. * Update docs/walkthroughs/06-saving-to-a-database.md * Update docs/walkthroughs/06-saving-to-a-database.md * Update docs/walkthroughs/06-saving-to-a-database.md * Runs prettier * docs: clarifies not setting editor values directly & plugin order * Changes reccommended order of withReact & withHistory, to match current knowleged Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
@@ -13,3 +13,9 @@ This sub-library tracks changes to the Slate value state over time, and enables
|
||||
## `withHistory`
|
||||
|
||||
The `withHistory` plugin keeps track of the operation history of a Slate editor as operations are applied to it, using undo and redo stacks.
|
||||
|
||||
When used with `withReact`, `withHistory` should be applied inside. For example:
|
||||
|
||||
```javascript
|
||||
const editor = useMemo(() => withReact(withHistory(createEditor())), [])
|
||||
```
|
||||
|
@@ -180,6 +180,12 @@ React-specific plugins for Slate editors
|
||||
|
||||
Adds React and DOM specific behaviors to the editor.
|
||||
|
||||
When used with `withHistory`, `withReact` should be applied outside. For example:
|
||||
|
||||
```javascript
|
||||
const editor = useMemo(() => withReact(withHistory(createEditor())), [])
|
||||
```
|
||||
|
||||
## Utils
|
||||
|
||||
Private convenience modules
|
||||
|
Reference in New Issue
Block a user