| 682 | } |
| 683 | |
| 684 | function defineKeyPropWarningGetter(props, displayName) { |
| 685 | var warnAboutAccessingKey = function () { |
| 686 | { |
| 687 | if (!specialPropKeyWarningShown) { |
| 688 | specialPropKeyWarningShown = true; |
| 689 | |
| 690 | error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); |
| 691 | } |
| 692 | } |
| 693 | }; |
| 694 | |
| 695 | warnAboutAccessingKey.isReactWarning = true; |
| 696 | Object.defineProperty(props, 'key', { |
| 697 | get: warnAboutAccessingKey, |
| 698 | configurable: true |
| 699 | }); |
| 700 | } |
| 701 | |
| 702 | function defineRefPropWarningGetter(props, displayName) { |
| 703 | var warnAboutAccessingRef = function () { |