Skip to main content

useOptionalServices

Returns the services, or null outside a ServicesProvider. For the few pieces, such as the live regions, that must still work when a test or a host mounts them without one.

This is a function exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import { useOptionalServices } from "@mapcairn/map";

function useOptionalServices(): Services | null;

Returns​

Services | null

See also​

Source: packages/map/src/services/ServicesProvider.tsx:55