WebViewProps
Props of WebView: the page to load, where it may navigate, and its events.
Verwendung
Embed a hosted help page
Dieser Typ wird verwendet von WebView
import { WebView } from 'kuito';
export default function Help() {
return <WebView flex={1} src="https://example.com/help" />;
}Typdeklaration
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
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
src | WebViewSource | Nein | The page to load. Set src or html, not both. |
html | string | { html: string; baseUrl?: string;} | Nein | Inline HTML, resolved against baseUrl when given. |
allowedOrigins | string[] | Nein | Origins the WebView navigates to, as wildcard patterns (https://*).
The main frame's navigations elsewhere open through Linking instead.
["http://*", "https://*"] by default. |
injectedJavaScript | string | Nein | Runs in the main frame each time a document finishes loading. |
javaScriptEnabled | boolean | Nein | True by default. |
swipeNavigation | boolean | Nein | iOS only: swipe from an edge to go back or forward. False by default. |
userAgent | string | Nein | Replaces the platform's user agent. |
onLoadStart | (event: WebViewNavigationEvent) => void | Nein | — |
onLoad | (event: WebViewNavigationEvent) => void | Nein | The page loaded. |
onLoadEnd | (event: WebViewNavigationEvent) => void | Nein | The load ended, loaded or failed. |
onError | (event: WebViewErrorEvent) => void | Nein | — |
onNavigate | (event: WebViewNavigationEvent) => void | Nein | The URL, title, loading state or history changed. |
onMessage | (event: WebViewMessageEvent) => void | Nein | — |
onLoadStart — Methodensignaturen
Signaturen
(event: WebViewNavigationEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | WebViewNavigationEvent | Ja | — |
Rückgabe
void
onLoad — Methodensignaturen
Signaturen
(event: WebViewNavigationEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | WebViewNavigationEvent | Ja | — |
Rückgabe
void
onLoadEnd — Methodensignaturen
Signaturen
(event: WebViewNavigationEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | WebViewNavigationEvent | Ja | — |
Rückgabe
void
onError — Methodensignaturen
Signaturen
(event: WebViewErrorEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | WebViewErrorEvent | Ja | — |
Rückgabe
void
onNavigate — Methodensignaturen
Signaturen
(event: WebViewNavigationEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | WebViewNavigationEvent | Ja | — |
Rückgabe
void
onMessage — Methodensignaturen
Signaturen
(event: WebViewMessageEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | WebViewMessageEvent | Ja | — |
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.