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

Function getTaskName

packages/react/src/jsx/ReactJSXElement.js:28–47  ·  packages/react/src/jsx/ReactJSXElement.js::getTaskName
(type)

Source from the content-addressed store, hash-verified

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

Calls 1

getComponentNameFromTypeFunction · 0.85

Tested by

no test coverage detected