import { useLocation } from "react-router-dom";

/**
 * Allows to parse query arguments from the `react-router` string.
 */
function useLocationQuery() {
    return Object.fromEntries(new URLSearchParams(useLocation().search).entries());
}

export { useLocationQuery };
