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

Function defineKeyPropWarningGetter

code/new-context-api/public/app.js:18050–18062  ·  view source on GitHub ↗
(props, displayName)

Source from the content-addressed store, hash-verified

18048}
18049
18050function defineKeyPropWarningGetter(props, displayName) {
18051 var warnAboutAccessingKey = function () {
18052 if (!specialPropKeyWarningShown) {
18053 specialPropKeyWarningShown = true;
18054 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);
18055 }
18056 };
18057 warnAboutAccessingKey.isReactWarning = true;
18058 Object.defineProperty(props, 'key', {
18059 get: warnAboutAccessingKey,
18060 configurable: true
18061 });
18062}
18063
18064function defineRefPropWarningGetter(props, displayName) {
18065 var warnAboutAccessingRef = function () {

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected