MCPcopy Create free account
hub / github.com/microsoft/SandDance / warnOnFunctionType

Function warnOnFunctionType

docs/external/js/react-dom.development.js:13554–13566  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13552 }
13553
13554 function warnOnFunctionType() {
13555 {
13556 var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
13557
13558 if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
13559 return;
13560 }
13561
13562 ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
13563
13564 error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
13565 }
13566 } // This wrapper function exists because I expect to clone the code in each path
13567 // to be able to optimize each path individually by branching early. This needs
13568 // a compiler or we can do it manually. Helpers that don't need this branching
13569 // live outside of this function.

Callers 4

createChildFunction · 0.85
updateSlotFunction · 0.85
updateFromMapFunction · 0.85
reconcileChildFibersFunction · 0.85

Calls 2

errorFunction · 0.70

Tested by

no test coverage detected