Function: makeWebshell
â–¸ makeWebshell<C, F>(WebView
: C, ...features
: F): WebshellComponent<C, F>
Creates a React component which decorates WebView
component with additional
capabilities such as:
- handling messages from the Web environment;
- sending messages to the Web environment, see WebHandle;
- running script in the Web environment.
example
import {
makeWebshell,
HandleHashChangeFeature,
HandleVisualViewportFeature
} from '@formidable-webview/webshell';
const features = [
new HandleHashChangeFeature(),
new HandleVisualViewportFeature()
]
const Webshell = makeWebshell(
WebView,
...features
);
Type parameters:
Name | Type | Description |
---|---|---|
C | ComponentType<any> | The type of the WebView component. |
F | Feature<{}, {}, {}>[] | The type for a collection of features to inject. |
Parameters:
Name | Type | Description |
---|---|---|
WebView | C | A WebView component, typically exported from react-native-webview . |
...features | F | Features to inject in the WebView . |
Returns: WebshellComponent<C, F>