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

Function defineRefPropWarningGetter

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

Source from the content-addressed store, hash-verified

18736}
18737
18738function defineRefPropWarningGetter(props, displayName) {
18739 var warnAboutAccessingRef = function () {
18740 if (!specialPropRefWarningShown) {
18741 specialPropRefWarningShown = true;
18742 warning(false, '%s: `ref` 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);
18743 }
18744 };
18745 warnAboutAccessingRef.isReactWarning = true;
18746 Object.defineProperty(props, 'ref', {
18747 get: warnAboutAccessingRef,
18748 configurable: true
18749 });
18750}
18751
18752/**
18753 * Factory method to create a new React element. This no longer adheres to

Callers 1

createElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected