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

Function defineKeyPropWarningGetter

code/communication/public/app.js:18724–18736  ·  view source on GitHub ↗
(props, displayName)

Source from the content-addressed store, hash-verified

18722}
18723
18724function defineKeyPropWarningGetter(props, displayName) {
18725 var warnAboutAccessingKey = function () {
18726 if (!specialPropKeyWarningShown) {
18727 specialPropKeyWarningShown = true;
18728 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);
18729 }
18730 };
18731 warnAboutAccessingKey.isReactWarning = true;
18732 Object.defineProperty(props, 'key', {
18733 get: warnAboutAccessingKey,
18734 configurable: true
18735 });
18736}
18737
18738function defineRefPropWarningGetter(props, displayName) {
18739 var warnAboutAccessingRef = function () {

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected