Const
Context provider that makes the HATEOAS client available to all child components.
Wrap your application (or a subtree) with this provider to enable useClient, useResource, useInfiniteCollection, and other hooks.
import { createClient } from '@hateoas-ts/resource';import { ResourceProvider } from '@hateoas-ts/resource-react';const client = createClient({ baseURL: 'https://api.example.com' });function App() { return ( <ResourceProvider client={client}> <YourApp /> </ResourceProvider> );} Copy
import { createClient } from '@hateoas-ts/resource';import { ResourceProvider } from '@hateoas-ts/resource-react';const client = createClient({ baseURL: 'https://api.example.com' });function App() { return ( <ResourceProvider client={client}> <YourApp /> </ResourceProvider> );}
Context provider that makes the HATEOAS client available to all child components.
Wrap your application (or a subtree) with this provider to enable useClient, useResource, useInfiniteCollection, and other hooks.