Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
rawQuery = React.useMemo(() => {
let pathname = {};
// handle checking SSR (#13)
if (locationIsObject) {
// in browser
if (windowIsDefined) {
pathname = parseQueryString(location.search);
} else {
// not in browser
let url = location.pathname;
if (location.search) {
url += location.search;
}
pathname = parseQueryURL(url).query;
}
}
return pathname || {};
}, [location.search, location.pathname, locationIsObject, windowIsDefined]);
}