MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / defineKeyPropWarningGetter

Function defineKeyPropWarningGetter

code/styling/public/app.js:18689–18701  ·  view source on GitHub ↗
(props, displayName)

Source from the content-addressed store, hash-verified

18687}
18688
18689function defineKeyPropWarningGetter(props, displayName) {
18690 var warnAboutAccessingKey = function () {
18691 if (!specialPropKeyWarningShown) {
18692 specialPropKeyWarningShown = true;
18693 warning(false, '%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);
18694 }
18695 };
18696 warnAboutAccessingKey.isReactWarning = true;
18697 Object.defineProperty(props, 'key', {
18698 get: warnAboutAccessingKey,
18699 configurable: true
18700 });
18701}
18702
18703function defineRefPropWarningGetter(props, displayName) {
18704 var warnAboutAccessingRef = function () {

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected