( publicInstance: component(...props: any), callerName: string, )
| 79 | } |
| 80 | |
| 81 | function warnNoop( |
| 82 | publicInstance: component(...props: any), |
| 83 | callerName: string, |
| 84 | ) { |
| 85 | if (__DEV__) { |
| 86 | const constructor = publicInstance.constructor; |
| 87 | const componentName = |
| 88 | (constructor && getComponentNameFromType(constructor)) || 'ReactClass'; |
| 89 | const warningKey = componentName + '.' + callerName; |
| 90 | if (didWarnAboutNoopUpdateForComponent[warningKey]) { |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | console.error( |
| 95 | 'Can only update a mounting component. ' + |
| 96 | 'This usually means you called %s() outside componentWillMount() on the server. ' + |
| 97 | 'This is a no-op.\n\nPlease check the code for the %s component.', |
| 98 | callerName, |
| 99 | componentName, |
| 100 | ); |
| 101 | didWarnAboutNoopUpdateForComponent[warningKey] = true; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | type InternalInstance = { |
| 106 | queue: null | Array<Object>, |
no test coverage detected