@redocly/graphql-docs
Version:
Redocly GraphQL docs
2 lines (1 loc) • 382 B
JavaScript
import{useMemo as r}from"react";import{useLocation as c}from"react-router-dom";import{useBaseUrlPath as i}from"./use-base-url-path.js";function h(e=!0){const o=i(),t=c();return r(()=>{const a=Object.assign(Object.create(t),t);return Object.defineProperty(a,"pathname",{get(){return e?t.pathname.replace(o,""):t.pathname},set(n){t.pathname=n}}),a},[o,t,e])}export{h as useLocation};