1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 07:22:55 +02:00

sCU Changes for #1058 (#1064)

* changing up should component update

* checking if it has nodes

* Update node.js

* more flexible checking
This commit is contained in:
Ryan Yurkanin
2017-09-06 22:54:54 -04:00
committed by Ian Storm Taylor
parent 4e945e2977
commit f6d5f9d6dd

View File

@@ -111,6 +111,10 @@ class Node extends React.Component {
// for simplicity we just let them through.
if (nextProps.node != props.node) return true
// If the Node has children that aren't just Text's then allow them to decide
// If they should update it or not.
if (nextProps.node.kind != 'text' && Text.isTextList(nextProps.node.nodes) == false) return true
// If the node is a block or inline, which can have custom renderers, we
// include an extra check to re-render if the node either becomes part of,
// or leaves, a selection. This is to make it simple for users to show a