@refinedev/core
Version:
refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.
21 lines (16 loc) • 719 B
text/typescript
import { useContext } from "react";
import { RefineContext } from "@contexts/refine";
import type { IRefineContextOptions } from "../../contexts/refine/types";
type UseSyncWithLocationType = () => {
syncWithLocation: IRefineContextOptions["syncWithLocation"];
};
/**
* List query parameter values can be edited manually by typing directly in the URL.
* To activate this feature `syncWithLocation` needs to be set to `true`.
*
* @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#syncwithlocation} for more details.
*/
export const useSyncWithLocation: UseSyncWithLocationType = () => {
const { syncWithLocation } = useContext(RefineContext);
return { syncWithLocation };
};