1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-12 18:24:03 +02:00

fix shouldComponentUpdate check on content

This commit is contained in:
Ian Storm Taylor
2016-08-01 12:30:30 -07:00
parent d7f65d5821
commit 5593d501e1

View File

@@ -84,12 +84,15 @@ class Content extends React.Component {
*/
shouldComponentUpdate = (props, state) => {
// If the state has been transformed natively, never re-render, or else we
// will end up duplicating content.
if (props.state.isNative) return false
return (
props.className != this.props.className ||
props.readOnly != this.props.readOnly ||
props.spellCheck != this.props.spellCheck ||
props.style != this.props.style ||
props.state.isNative !== true
props.style != this.props.style
)
}