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

Function defineKeyPropWarningGetter

code/third-party/public/app.js:17922–17934  ·  view source on GitHub ↗
(props, displayName)

Source from the content-addressed store, hash-verified

17920}
17921
17922function defineKeyPropWarningGetter(props, displayName) {
17923 var warnAboutAccessingKey = function () {
17924 if (!specialPropKeyWarningShown) {
17925 specialPropKeyWarningShown = true;
17926 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);
17927 }
17928 };
17929 warnAboutAccessingKey.isReactWarning = true;
17930 Object.defineProperty(props, 'key', {
17931 get: warnAboutAccessingKey,
17932 configurable: true
17933 });
17934}
17935
17936function defineRefPropWarningGetter(props, displayName) {
17937 var warnAboutAccessingRef = function () {

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected