1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 03:32:36 +02:00

add resetKeyGenerator docs

This commit is contained in:
Ian Storm Taylor
2016-11-29 17:30:23 -08:00
parent 450ffc92c7
commit 74a3b51098

View File

@@ -11,6 +11,7 @@ import {
Utility functions that ship with Slate that may be useful for certain use cases.
- [`findDOMNode`](#finddomnode)
- [`resetKeyGenerator`](#resetkeygenerator)
- [`setKeyGenerator`](#setkeygenerator)
@@ -21,6 +22,11 @@ Utility functions that ship with Slate that may be useful for certain use cases.
Allows you to find the DOM node for a Slate [`Node`](../models/node.md) by passing its `key` string. Modelled after React's built-in `findDOMNode` helper.
### `resetKeyGenerator`
`resetkeygenerator() => Void`
Resets Slate's internal key generating function to its default state. This is useful for server-side rendering, or anywhere you want to ensure fresh, deterministic creation of keys.
### `setKeyGenerator`
`setKeyGenerator(generator: Function) => Void`