mirror of
https://github.com/outline/outline.git
synced 2026-01-04 18:21:23 -06:00
19 lines
429 B
TypeScript
19 lines
429 B
TypeScript
import { useMemo } from "react";
|
|
import { useLocation } from "react-router-dom";
|
|
|
|
/**
|
|
* Hook to access URL query parameters from the current location.
|
|
*
|
|
* @returns URLSearchParams object containing the current URL query parameters
|
|
*/
|
|
export default function useQuery() {
|
|
const location = useLocation();
|
|
|
|
const query = useMemo(
|
|
() => new URLSearchParams(location.search),
|
|
[location.search]
|
|
);
|
|
|
|
return query;
|
|
}
|