Delete usePageTitle
We got rid of all its call sites, hooray!
This commit is contained in:
parent
16c9e1a25d
commit
0176792cb9
1 changed files with 0 additions and 24 deletions
|
@ -224,30 +224,6 @@ export function useDebounce(
|
||||||
return shouldForceReset ? value : debouncedValue;
|
return shouldForceReset ? value : debouncedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* usePageTitle sets the page title!
|
|
||||||
*/
|
|
||||||
export function usePageTitle(title, { skip = false } = {}) {
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (skip) return;
|
|
||||||
try {
|
|
||||||
document.title = title
|
|
||||||
? `${title} | Dress to Impress`
|
|
||||||
: "Dress to Impress";
|
|
||||||
} catch (e) {
|
|
||||||
// I've been seeing Sentry errors that we can't read `title` of
|
|
||||||
// undefined, with no traceback. This is the only `.title` I see in our
|
|
||||||
// codebase, aside from unpacking props that I'm pretty sure aren't
|
|
||||||
// null... so I'm adding this to help confirm!
|
|
||||||
logAndCapture(
|
|
||||||
new Error(
|
|
||||||
`Could not set page title: ${e.message}. Document is: ${document}.`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}, [title, skip]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* useFetch uses `fetch` to fetch the given URL, and returns the request state.
|
* useFetch uses `fetch` to fetch the given URL, and returns the request state.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue