Utilização

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} />
</>;

Declaração do tipo

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

Membros 5

NomeTipoObrigatórioDescrição
urlstringSim—
titlestringSim—
loadingbooleanSim—
canGoBackbooleanSim—
canGoForwardbooleanSim—
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.