Verwendung

Follow navigation inside embedded content.

tsx
// Follow navigation inside embedded content.
import { Text, WebView, signal, type WebViewNavigation } from 'kuito';

const state = signal<WebViewNavigation | null>(null);

// Every load and navigation event carries the page's state.
const follow = (event: WebViewNavigation) => (state.value = event);

<>
  <Text>{state.value?.loading ? 'Loading…' : state.value?.title}</Text>
  <WebView src="https://example.com" flex={1} onLoad={follow} onNavigate={follow} />
</>;

Typdeklaration

ts
export type WebViewNavigation = {
  url: string;
  title: string;
  loading: boolean;
  canGoBack: boolean;
  canGoForward: boolean;
};

Mitglieder 5

NameTypErforderlichBeschreibung
urlstringJa—
titlestringJa—
loadingbooleanJa—
canGoBackbooleanJa—
canGoForwardbooleanJa—
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.