mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-19 13:41:19 +02:00
Immutable check warning: Log concerned node
This commit is contained in:
@@ -103,7 +103,7 @@ class Node extends React.Component {
|
|||||||
if (!Immutable.is(props.node, this.props.node)) {
|
if (!Immutable.is(props.node, this.props.node)) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
warning('Encountered different references for identical node values in "shouldComponentUpdate". Check that you are preserving references')
|
warning('Encountered different references for identical node values in "shouldComponentUpdate". Check that you are preserving references for the following node:', props.node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,13 +9,13 @@ const __DEV__ = (
|
|||||||
* @param {String} message
|
* @param {String} message
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function warning(message) {
|
export default function warning(message, ...more) {
|
||||||
if (!__DEV__) {
|
if (!__DEV__) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof console !== 'undefined') {
|
if (typeof console !== 'undefined') {
|
||||||
console.error(`Warning: ${message}`) // eslint-disable-line no-console
|
console.error(`Warning: ${message}`, ...more) // eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user