diff --git a/App.tsx b/App.tsx index 74e17dc..bcfef61 100644 --- a/App.tsx +++ b/App.tsx @@ -1,6 +1,9 @@ import React from 'react' import PdfReader from './src/' -import { WebViewErrorEvent } from 'react-native-webview/lib/WebViewTypes' +import { + WebViewErrorEvent, + WebViewHttpErrorEvent, +} from 'react-native-webview/lib/WebViewTypes' import { View, Text, Modal, Button, SafeAreaView, Switch } from 'react-native' const base64 = @@ -20,11 +23,13 @@ const base64 = const uri = 'http://gahp.net/wp-content/uploads/2017/09/sample.pdf' function App() { - const [error, setError] = React.useState( - undefined, - ) + const [error, setError] = React.useState< + WebViewErrorEvent | WebViewHttpErrorEvent | string | undefined + >(undefined) const [visible, setVisible] = React.useState(false) const [pdfType, setPdfType] = React.useState(false) + const [useGoogleReader, setUseGoogleReader] = React.useState(false) + const [withScroll, setWithScroll] = React.useState(false) if (error) { return ( - {error.nativeEvent.description} + {error.toString()} ) } + return (