Hiyve Components - v1.0.0
    Preparing search index...

    Function useClient

    • Escape hatch for accessing the raw store and client instances.

      Use this for advanced scenarios where the provided hooks do not cover your use case. Prefer the typed hooks (e.g., useRoom, useChat) for most cases, as they keep subscriptions efficient.

      Returns { client: Client | null; store: HiyveStoreRN }

      Object containing store (the HiyveStoreRN instance) and client (the underlying RN WebRTC client, or null if not connected)

      import { useClient } from '@hiyve/rn-react';

      function AdvancedControls() {
      const { store, client } = useClient();

      const handleCustomAction = () => {
      if (client) {
      // Direct client access for unsupported features
      }
      };

      return <Button title="Custom" onPress={handleCustomAction} />;
      }