Creates a value provider with a default value.

  • Type Parameters

    • P extends unknown = object

    Parameters

    • OptionaldefaultValue: P

      The default value for the provider.

    Returns readonly [
        (__namedParameters: { children: ReactNode; payload: P }) => Element,
        () => P,
    ]

    A tuple containing the provider component and a hook to access the value.