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

Function defineKeyPropWarningGetter

code/redux/public/app.js:20033–20045  ·  view source on GitHub ↗
(props, displayName)

Source from the content-addressed store, hash-verified

20031}
20032
20033function defineKeyPropWarningGetter(props, displayName) {
20034 var warnAboutAccessingKey = function () {
20035 if (!specialPropKeyWarningShown) {
20036 specialPropKeyWarningShown = true;
20037 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);
20038 }
20039 };
20040 warnAboutAccessingKey.isReactWarning = true;
20041 Object.defineProperty(props, 'key', {
20042 get: warnAboutAccessingKey,
20043 configurable: true
20044 });
20045}
20046
20047function defineRefPropWarningGetter(props, displayName) {
20048 var warnAboutAccessingRef = function () {

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected