mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +02:00
Improve rendering performance when schema has no decorators
This commit is contained in:
@@ -313,7 +313,7 @@ class Node extends React.Component {
|
|||||||
renderText = () => {
|
renderText = () => {
|
||||||
const { node, schema, state } = this.props
|
const { node, schema, state } = this.props
|
||||||
const { document } = state
|
const { document } = state
|
||||||
const decorators = document.getDescendantDecorators(node.key, schema)
|
const decorators = schema.hasDecorators ? document.getDescendantDecorators(node.key, schema) : []
|
||||||
const ranges = node.getRanges(decorators)
|
const ranges = node.getRanges(decorators)
|
||||||
let offset = 0
|
let offset = 0
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user