@clerk/clerk-react
Version:
Clerk React library
52 lines (50 loc) • 1.33 kB
JavaScript
import {
MultisessionAppSupport
} from "./chunk-JPAFWK3P.mjs";
import {
errorThrower,
incompatibleRoutingWithPathProvidedError,
noPathProvidedError,
setErrorThrowerOptions,
useDerivedAuth
} from "./chunk-XIVXL4LQ.mjs";
import "./chunk-OANWQR3B.mjs";
// src/hooks/useRoutingProps.ts
function useRoutingProps(componentName, props, routingOptions) {
const path = props.path || (routingOptions == null ? void 0 : routingOptions.path);
const routing = props.routing || (routingOptions == null ? void 0 : routingOptions.routing) || "path";
if (routing === "path") {
if (!path) {
return errorThrower.throw(noPathProvidedError(componentName));
}
return {
...routingOptions,
...props,
routing: "path"
};
}
if (props.path) {
return errorThrower.throw(incompatibleRoutingWithPathProvidedError(componentName));
}
return {
...routingOptions,
...props,
path: void 0
};
}
// src/internal.ts
import {
clerkJsScriptUrl,
buildClerkJsScriptAttributes,
setClerkJsLoadingErrorPackageName
} from "@clerk/shared/loadClerkJsScript";
export {
MultisessionAppSupport,
buildClerkJsScriptAttributes,
clerkJsScriptUrl,
setClerkJsLoadingErrorPackageName,
setErrorThrowerOptions,
useDerivedAuth,
useRoutingProps
};
//# sourceMappingURL=internal.mjs.map