1
0
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:
Samy Pessé
2016-11-03 11:22:47 +01:00
parent a3b7b0789f
commit d6beed6744

View File

@@ -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