@ab6162/react-native-webview-autoheight
Version:
An autoheight for React Native WebView. Updated for React 18+.
30 lines (24 loc) • 660 B
TypeScript
import WebView, {WebViewProps} from 'react-native-webview';
import {StyleProp, ViewStyle} from 'react-native';
export interface StylesFile {
href: string;
type: string;
rel: string;
}
export interface SizeUpdate {
width: number;
height: number;
}
export interface WebViewAutoHeightProps extends WebViewProps {
onSizeUpdated?: (size: SizeUpdate) => void;
files?: StylesFile[];
style?: StyleProp<ViewStyle>;
customScript?: string;
customStyle?: string;
viewportContent?: string;
scalesPageToFit?: boolean;
scrollEnabledWithZoomedin?: boolean;
}
export default class WebViewAutoHeight extends WebView<
WebViewAutoHeightProps
> {}