WebViewProps
Props of WebView: the page to load, where it may navigate, and its events.
Utilisation
Embed a hosted help page
Ce type est utilisé par WebView
import { WebView } from 'kuito';
export default function Help() {
return <WebView flex={1} src="https://example.com/help" />;
}Déclaration du type
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;
};Membres 13
| Nom | Type | Requis | Description |
|---|---|---|---|
src | WebViewSource | Non | The page to load. Set src or html, not both. |
html | string | { html: string; baseUrl?: string;} | Non | Inline HTML, resolved against baseUrl when given. |
allowedOrigins | string[] | Non | 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 | Non | Runs in the main frame each time a document finishes loading. |
javaScriptEnabled | boolean | Non | True by default. |
swipeNavigation | boolean | Non | iOS only: swipe from an edge to go back or forward. False by default. |
userAgent | string | Non | Replaces the platform's user agent. |
onLoadStart | (event: WebViewNavigationEvent) => void | Non | — |
onLoad | (event: WebViewNavigationEvent) => void | Non | The page loaded. |
onLoadEnd | (event: WebViewNavigationEvent) => void | Non | The load ended, loaded or failed. |
onError | (event: WebViewErrorEvent) => void | Non | — |
onNavigate | (event: WebViewNavigationEvent) => void | Non | The URL, title, loading state or history changed. |
onMessage | (event: WebViewMessageEvent) => void | Non | — |
onLoadStart — signatures de méthode
Signatures
(event: WebViewNavigationEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | WebViewNavigationEvent | Oui | — |
Retourne
void
onLoad — signatures de méthode
Signatures
(event: WebViewNavigationEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | WebViewNavigationEvent | Oui | — |
Retourne
void
onLoadEnd — signatures de méthode
Signatures
(event: WebViewNavigationEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | WebViewNavigationEvent | Oui | — |
Retourne
void
onError — signatures de méthode
Signatures
(event: WebViewErrorEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | WebViewErrorEvent | Oui | — |
Retourne
void
onNavigate — signatures de méthode
Signatures
(event: WebViewNavigationEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | WebViewNavigationEvent | Oui | — |
Retourne
void
onMessage — signatures de méthode
Signatures
(event: WebViewMessageEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | WebViewMessageEvent | Oui | — |
Retourne
void
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.