MCPcopy
hub / github.com/marmelab/react-admin / useResourceContext

Function useResourceContext

packages/ra-core/src/core/useResourceContext.ts:36–43  ·  view source on GitHub ↗
(
    props?: ResourceInformationsType
)

Source from the content-addressed store, hash-verified

34 * @returns {ResourceContextValue} The resource name, e.g. 'posts'
35 */
36export const useResourceContext = <
37 ResourceInformationsType extends Partial<{ resource: string }>,
38>(
39 props?: ResourceInformationsType
40): ResourceContextValue => {
41 const context = useContext(ResourceContext);
42 return (props && props.resource) || context;
43};

Callers 15

OfflineFunction · 0.90
FieldToggleFunction · 0.90
EditGuesserViewFunction · 0.90
ShowGuesserViewFunction · 0.90
TabbedFormViewFunction · 0.90
SimpleFormConfigurableFunction · 0.90
EmptyFunction · 0.90
CountFunction · 0.90
ListNoResultsFunction · 0.90
ListGuesserFunction · 0.90
ListGuesserViewFunction · 0.90
SingleFieldListFunction · 0.90

Calls

no outgoing calls

Tested by 5

MyComponentFunction · 0.72
MyComponentFunction · 0.72
MyComponentFunction · 0.72
LoadingFunction · 0.72
EmptyFunction · 0.72