@koordinates/xstate-tree
Version:
Build UIs with Actors using xstate and React
19 lines (18 loc) • 497 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHref = void 0;
const joinRoutes_1 = require("./joinRoutes");
/**
* Returns a string created by joining the base path and routes URL
*/
function useHref(to, params, query) {
try {
const routePath = to.reverse({ params, query });
return (0, joinRoutes_1.joinRoutes)(to.basePath, routePath);
}
catch (e) {
console.error(e);
}
return "";
}
exports.useHref = useHref;