Query parameters for fetching branches (e.g., page, pageSize, placeId, etc.)
An object containing:
const { branches, loading, errors } = useBranches({
params: { page: 1, pageSize: 10, placeId: '123' },
enabled: true,
});
if (loading) return <div>Loading...</div>;
if (errors) return <div>Error: {String(errors)}</div>;
return (
<ul>
{branches.map(branch => (
<li key={branch.id}>{branch.name}</li>
))}
</ul>
);
React hook to fetch branches, with support for pagination and filtering.
The hook handles loading state, error state, and returns the fetched branches. It can also be conditionally enabled.