(props, displayName)
| 110 | } |
| 111 | |
| 112 | function defineKeyPropWarningGetter(props, displayName) { |
| 113 | if (__DEV__) { |
| 114 | const warnAboutAccessingKey = function () { |
| 115 | if (!specialPropKeyWarningShown) { |
| 116 | specialPropKeyWarningShown = true; |
| 117 | console.error( |
| 118 | '%s: `key` is not a prop. Trying to access it will result ' + |
| 119 | 'in `undefined` being returned. If you need to access the same ' + |
| 120 | 'value within the child component, you should pass it as a different ' + |
| 121 | 'prop. (https://react.dev/link/special-props)', |
| 122 | displayName, |
| 123 | ); |
| 124 | } |
| 125 | }; |
| 126 | warnAboutAccessingKey.isReactWarning = true; |
| 127 | Object.defineProperty(props, 'key', { |
| 128 | get: warnAboutAccessingKey, |
| 129 | configurable: true, |
| 130 | }); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | function elementRefGetterWithDeprecationWarning() { |
| 135 | if (__DEV__) { |
no outgoing calls
no test coverage detected