(callback: mixed)
| 45 | } |
| 46 | |
| 47 | function warnOnInvalidCallback(callback: mixed) { |
| 48 | if (__DEV__) { |
| 49 | if (callback === null || typeof callback === 'function') { |
| 50 | return; |
| 51 | } |
| 52 | // eslint-disable-next-line react-internal/safe-string-coercion |
| 53 | const key = String(callback); |
| 54 | if (!didWarnOnInvalidCallback.has(key)) { |
| 55 | didWarnOnInvalidCallback.add(key); |
| 56 | console.error( |
| 57 | 'Expected the last optional `callback` argument to be a ' + |
| 58 | 'function. Instead received: %s.', |
| 59 | callback, |
| 60 | ); |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | function warnOnUndefinedDerivedState(type: any, partialState: any) { |
| 66 | if (__DEV__) { |
no test coverage detected