rooks
Version:
Essential React custom hooks ⚓ to super charge your components!
26 lines (25 loc) • 895 B
JavaScript
var isDevelopmentEnvironment = process.env.NODE_ENV !== "production";
// eslint-disable-next-line import/no-mutable-exports
var warning = function () { };
if (isDevelopmentEnvironment) {
var printWarning_1 = function (actualMessage) {
var message = "Warning: ".concat(actualMessage);
if (typeof console !== "undefined") {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the call site that caused this warning to fire.
throw new Error(message);
// eslint-disable-next-line no-empty
}
catch (_a) { }
};
warning = function (condition, actualMessage) {
if (!condition) {
printWarning_1(actualMessage);
}
};
}
export { warning };