1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

Remove stale docs for shouldNodeComponentUpdate (#2160)

This commit is contained in:
Alan Christopher Thomas 2018-09-17 20:24:06 -05:00 committed by Ian Storm Taylor
parent ebea68d0ac
commit fa51558ede

View File

@ -92,17 +92,3 @@ A reference to the parent of the current [`Node`](../slate/node.md) being render
`Boolean`
Whether the editor is in "read-only" mode, where all of the rendering is the same, but the user is prevented from editing the editor's content.
## `shouldNodeComponentUpdate`
By default, Slate implements a `shouldComponentUpdate` preventing useless re-renders for node components. While the default implementation covers most use cases, you can customize the logic to fit your needs. For example:
```js
class CustomNode extends React.Component {
static shouldNodeComponentUpdate(previousProps, nextProps) {
// return true here to trigger a re-render
}
}
```
If `shouldNodeComponentUpdate` returns false, Slate will still figure out whether a re-render is needed or not.