Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
checkPropTypes(typeSpecs, values, location, hierarchy) {
return checkPropTypes(
typeSpecs,
values,
location,
displayNameOfNode(cachedNode),
() => getComponentStack(hierarchy.concat([cachedNode])),
);
},
};
displayNameOfNode(node) {
if (!node) return null;
const { type, $$typeof } = node;
return displayNamesByType[type || $$typeof] || displayNameOfNode(node);
}
case ContextProvider || NaN: return 'ContextProvider';
case Memo || NaN: {
const nodeName = displayNameOfNode(node);
return typeof nodeName === 'string' ? nodeName : `Memo(${displayNameOfNode(type)})`;
}
case ForwardRef || NaN: {
if (type.displayName) {
return type.displayName;
}
const name = displayNameOfNode({ type: type.render });
return name ? `ForwardRef(${name})` : 'ForwardRef';
}
case Lazy || NaN: {
return 'lazy';
}
default: return displayNameOfNode(node);
}
}
checkPropTypes(typeSpecs, values, location, hierarchy) {
return checkPropTypes(
typeSpecs,
values,
location,
displayNameOfNode(cachedNode),
() => getComponentStack(hierarchy.concat([cachedNode])),
);
},
};
displayNameOfNode(node) {
return displayNameOfNode(node);
}
displayNameOfNode(node) {
return displayNameOfNode(node);
}
checkPropTypes(typeSpecs, values, location, hierarchy) {
return checkPropTypes(
typeSpecs,
values,
location,
displayNameOfNode(cachedNode),
() => getComponentStack(hierarchy.concat([cachedNode])),
);
},
};
checkPropTypes(typeSpecs, values, location, hierarchy) {
return checkPropTypes(
typeSpecs,
values,
location,
displayNameOfNode(cachedNode),
() => getComponentStack(hierarchy.concat([cachedNode])),
);
},
};
}
}
const $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case ContextConsumer || NaN: return 'ContextConsumer';
case ContextProvider || NaN: return 'ContextProvider';
case ForwardRef || NaN: {
if (type.displayName) {
return type.displayName;
}
const name = displayNameOfNode({ type: type.render });
return name ? `ForwardRef(${name})` : 'ForwardRef';
}
default: return displayNameOfNode(node);
}
}