Verwendung

Embed a hosted help page

Dieser Typ wird verwendet von WebView

tsx
import { WebView } from 'kuito';

export default function Help() {
  return <WebView flex={1} src="https://example.com/help" />;
}

Typdeklaration

ts
export type WebViewProps = {
  /** The page to load. Set `src` or `html`, not both. */
  src?: WebViewSource;
  /** Inline HTML, resolved against `baseUrl` when given. */
  html?: string | { html: string; baseUrl?: string };
  /**
   * Origins the WebView navigates to, as wildcard patterns (`https://*`).
   * The main frame's navigations elsewhere open through Linking instead.
   * `["http://*", "https://*"]` by default.
   */
  allowedOrigins?: string[];
  /** Runs in the main frame each time a document finishes loading. */
  injectedJavaScript?: string;
  /** True by default. */
  javaScriptEnabled?: boolean;
  /** iOS only: swipe from an edge to go back or forward. False by default. */
  swipeNavigation?: boolean;
  /** Replaces the platform's user agent. */
  userAgent?: string;
  onLoadStart?: (event: WebViewNavigationEvent) => void;
  /** The page loaded. */
  onLoad?: (event: WebViewNavigationEvent) => void;
  /** The load ended, loaded or failed. */
  onLoadEnd?: (event: WebViewNavigationEvent) => void;
  onError?: (event: WebViewErrorEvent) => void;
  /** The URL, title, loading state or history changed. */
  onNavigate?: (event: WebViewNavigationEvent) => void;
  onMessage?: (event: WebViewMessageEvent) => void;
};

Mitglieder 13

NameTypErforderlichBeschreibung
srcWebViewSourceNeinThe page to load. Set src or html, not both.
htmlstring | { html: string; baseUrl?: string;}NeinInline HTML, resolved against baseUrl when given.
allowedOriginsstring[]NeinOrigins the WebView navigates to, as wildcard patterns (https://*). The main frame's navigations elsewhere open through Linking instead. ["http://*", "https://*"] by default.
injectedJavaScriptstringNeinRuns in the main frame each time a document finishes loading.
javaScriptEnabledbooleanNeinTrue by default.
swipeNavigationbooleanNeiniOS only: swipe from an edge to go back or forward. False by default.
userAgentstringNeinReplaces the platform's user agent.
onLoadStart(event: WebViewNavigationEvent) => voidNein—
onLoad(event: WebViewNavigationEvent) => voidNeinThe page loaded.
onLoadEnd(event: WebViewNavigationEvent) => voidNeinThe load ended, loaded or failed.
onError(event: WebViewErrorEvent) => voidNein—
onNavigate(event: WebViewNavigationEvent) => voidNeinThe URL, title, loading state or history changed.
onMessage(event: WebViewMessageEvent) => voidNein—
onLoadStart — Methodensignaturen

Signaturen

ts
(event: WebViewNavigationEvent): void

Parameter

NameTypErforderlichBeschreibung
eventWebViewNavigationEventJa—

Rückgabe

void

onLoad — Methodensignaturen

Signaturen

ts
(event: WebViewNavigationEvent): void

Parameter

NameTypErforderlichBeschreibung
eventWebViewNavigationEventJa—

Rückgabe

void

onLoadEnd — Methodensignaturen

Signaturen

ts
(event: WebViewNavigationEvent): void

Parameter

NameTypErforderlichBeschreibung
eventWebViewNavigationEventJa—

Rückgabe

void

onError — Methodensignaturen

Signaturen

ts
(event: WebViewErrorEvent): void

Parameter

NameTypErforderlichBeschreibung
eventWebViewErrorEventJa—

Rückgabe

void

onNavigate — Methodensignaturen

Signaturen

ts
(event: WebViewNavigationEvent): void

Parameter

NameTypErforderlichBeschreibung
eventWebViewNavigationEventJa—

Rückgabe

void

onMessage — Methodensignaturen

Signaturen

ts
(event: WebViewMessageEvent): void

Parameter

NameTypErforderlichBeschreibung
eventWebViewMessageEventJa—

Rückgabe

void

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