mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
52c673261b
* Add JSDoc to hooks in app/hooks directory * lint --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom.moor@gmail.com>
19 lines
429 B
TypeScript
19 lines
429 B
TypeScript
import React 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 = React.useMemo(
|
|
() => new URLSearchParams(location.search),
|
|
[location.search]
|
|
);
|
|
|
|
return query;
|
|
}
|