MCPcopy
hub / github.com/react/react / getTaskName

Function getTaskName

packages/react/src/jsx/ReactJSXElement.js:28–47  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

26 : () => null;
27
28function getTaskName(type) {
29 if (type === REACT_FRAGMENT_TYPE) {
30 return '<>';
31 }
32 if (
33 typeof type === 'object' &&
34 type !== null &&
35 type.$$typeof === REACT_LAZY_TYPE
36 ) {
37 // We don't want to eagerly initialize the initializer in DEV mode so we can't
38 // call it to extract the type so we don't know the type of this component.
39 return '<...>';
40 }
41 try {
42 const name = getComponentNameFromType(type);
43 return name ? '<' + name + '>' : '<...>';
44 } catch (x) {
45 return '<...>';
46 }
47}
48
49function getOwner() {
50 if (__DEV__) {

Calls 1

getComponentNameFromTypeFunction · 0.85

Tested by

no test coverage detected