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

Function defineKeyPropWarningGetter

code/composition/public/app.js:18827–18839  ·  view source on GitHub ↗
(props, displayName)

Source from the content-addressed store, hash-verified

18825}
18826
18827function defineKeyPropWarningGetter(props, displayName) {
18828 var warnAboutAccessingKey = function () {
18829 if (!specialPropKeyWarningShown) {
18830 specialPropKeyWarningShown = true;
18831 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);
18832 }
18833 };
18834 warnAboutAccessingKey.isReactWarning = true;
18835 Object.defineProperty(props, 'key', {
18836 get: warnAboutAccessingKey,
18837 configurable: true
18838 });
18839}
18840
18841function defineRefPropWarningGetter(props, displayName) {
18842 var warnAboutAccessingRef = function () {

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected