Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function useContextWithoutDefaultValue<p>(ConsumingComponent: React.ComponentType</p><p>) {
const value = useContext(context);
/* istanbul ignore if */
if (value === undefined) {
throw new UiError(
UiComponents.loggerCategory(ConsumingComponent),
`'${getClassName(ConsumingComponent)}' expects to be wrapped by a '${contextName}' provider.`,
);
}
return value;
}
</p>
public static loggerCategory(obj: any): string {
const className = getClassName(obj);
const category = `ui-test-app.${className}`;
return category;
}
public static loggerCategory(obj: any): string {
const className = getClassName(obj);
const category = UiCore.packageName + (className ? `.${className}` : "");
return category;
}
public static loggerCategory(obj: any): string {
const className = getClassName(obj);
const category = UiFramework.packageName + (className ? `.${className}` : "");
return category;
}
public static loggerCategory(obj: any): string {
const className = getClassName(obj);
const category = UiComponents.packageName + (className ? `.${className}` : "");
return category;
}