MCPcopy Index your code
hub / github.com/plotly/dash / warnIfStringRefCannotBeAutoConverted

Function warnIfStringRefCannotBeAutoConverted

dash/deps/react@18.2.0.js:680–692  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

678 }
679
680 function warnIfStringRefCannotBeAutoConverted(config) {
681 {
682 if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
683 var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
684
685 if (!didWarnAboutStringRefs[componentName]) {
686 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
687
688 didWarnAboutStringRefs[componentName] = true;
689 }
690 }
691 }
692 }
693 /**
694 * Factory method to create a new React element. This no longer adheres to
695 * the class pattern, so do not use new to call it. Also, instanceof check

Callers 1

createElementFunction · 0.70

Calls 2

getComponentNameFromTypeFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…