WebViewProps
Props of WebView: the page to load, where it may navigate, and its events.
Utilização
Embed a hosted help page
Este tipo é usado por WebView
import { WebView } from 'kuito';
export default function Help() {
return <WebView flex={1} src="https://example.com/help" />;
}Declaração do tipo
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;
};Membros 13
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
src | WebViewSource | Não | The page to load. Set src or html, not both. |
html | string | { html: string; baseUrl?: string;} | Não | Inline HTML, resolved against baseUrl when given. |
allowedOrigins | string[] | Não | 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 | Não | Runs in the main frame each time a document finishes loading. |
javaScriptEnabled | boolean | Não | True by default. |
swipeNavigation | boolean | Não | iOS only: swipe from an edge to go back or forward. False by default. |
userAgent | string | Não | Replaces the platform's user agent. |
onLoadStart | (event: WebViewNavigationEvent) => void | Não | — |
onLoad | (event: WebViewNavigationEvent) => void | Não | The page loaded. |
onLoadEnd | (event: WebViewNavigationEvent) => void | Não | The load ended, loaded or failed. |
onError | (event: WebViewErrorEvent) => void | Não | — |
onNavigate | (event: WebViewNavigationEvent) => void | Não | The URL, title, loading state or history changed. |
onMessage | (event: WebViewMessageEvent) => void | Não | — |
onLoadStart — assinaturas de método
Assinaturas
(event: WebViewNavigationEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | WebViewNavigationEvent | Sim | — |
Devolve
void
onLoad — assinaturas de método
Assinaturas
(event: WebViewNavigationEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | WebViewNavigationEvent | Sim | — |
Devolve
void
onLoadEnd — assinaturas de método
Assinaturas
(event: WebViewNavigationEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | WebViewNavigationEvent | Sim | — |
Devolve
void
onError — assinaturas de método
Assinaturas
(event: WebViewErrorEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | WebViewErrorEvent | Sim | — |
Devolve
void
onNavigate — assinaturas de método
Assinaturas
(event: WebViewNavigationEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | WebViewNavigationEvent | Sim | — |
Devolve
void
onMessage — assinaturas de método
Assinaturas
(event: WebViewMessageEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | WebViewMessageEvent | Sim | — |
Devolve
void
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.