useResourceWithRoute
useResourceWithRoute is used to get the properties of a resource defined as a element of the resources. It returns a function and this function allows us to access the resource with the route option we gave to the resource.
The hook is used internal in refine. Normally you don't need this hook, but we export it as it may be useful for some use-cases.
import { useResourceWithRoute } from "@pankod/refine-core";
const resourceWithRoute = useResourceWithRoute();
API Reference
Return value
| Description | Type |
|---|---|
| resourceWithRoute | (route: string) => IResourceItem |
The
canCreate,canShowandcanEditproperties are defined automatically if thecreate,showandeditcomponents are defined on theresourcesproperty in<Refine>.