mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-09 08:46:35 +02:00
update utils docs
This commit is contained in:
@@ -1,8 +1,25 @@
|
|||||||
|
|
||||||
# Utils
|
# Utils
|
||||||
|
|
||||||
These are extra utility functions that ship with Slate that may be useful for certain use cases.
|
```js
|
||||||
|
import {
|
||||||
|
findDOMNode,
|
||||||
|
setKeyGenerator
|
||||||
|
} from 'slate'
|
||||||
|
```
|
||||||
|
|
||||||
|
Utility functions that ship with Slate that may be useful for certain use cases.
|
||||||
|
|
||||||
|
- [`findDOMNode`](#finddomnode)
|
||||||
|
- [`setKeyGenerator`](#setkeygenerator)
|
||||||
|
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### `findDOMNode`
|
||||||
|
`findDOMNode(key: String) => DOMElement`
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
### `setKeyGenerator`
|
### `setKeyGenerator`
|
||||||
`setKeyGenerator(generator: Function) => Void`
|
`setKeyGenerator(generator: Function) => Void`
|
||||||
|
Reference in New Issue
Block a user