Skip to content

Commit 1b55c2e

Browse files
committed
Code review changes made for #11140
1 parent 8b9760b commit 1b55c2e

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/isomorphic/modern/class/ReactNoopUpdateQueue.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@ function warnNoop(publicInstance, callerName) {
2020
const currentComponent =
2121
(constructor && (constructor.displayName || constructor.name)) ||
2222
'ReactClass';
23-
const currentComponentError =
24-
callerName +
25-
'(...): Can only update a mounted or mounting component. ' +
26-
'This usually means you called ' +
27-
callerName +
28-
'() on an unmounted component. ' +
29-
'This is a no-op.\n\nPlease check the code for the ' +
30-
currentComponent +
31-
' component.';
23+
const currentComponentError = `${callerName}_${currentComponent}`;
3224

3325
warning(
3426
!!errorInfo[currentComponentError],

src/renderers/shared/server/ReactPartialRenderer.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,7 @@ function warnNoop(
168168
var constructor = publicInstance.constructor;
169169
const currentComponent =
170170
(constructor && getComponentName(constructor)) || 'ReactClass';
171-
const currentComponentError =
172-
callerName +
173-
'(...): Can only update a mounting component. ' +
174-
'This usually means you called ' +
175-
callerName +
176-
'() outside componentWillMount() on the server. ' +
177-
'This is a no-op.\n\nPlease check the code for the ' +
178-
currentComponent +
179-
' component.';
171+
const currentComponentError = `${callerName}_${currentComponent}`;
180172

181173
warning(
182174
!!errorInfo[currentComponentError],

0 commit comments

Comments
 (0)