Open IanKirkham opened 2 months ago
What react-native version are you using? 0.75.2
react-native
What react-native-pdf version are you using? 6.7.5
react-native-pdf
What platform does your issue occur on? (android/ios/both) android
Describe your issue as precisely as possible : Issue is occurring on 6.7.5 but not reproducible on 6.7.4. Repro:
react-navigation
Join a screenshot or video of the problem on the simulator or device?
Show us the code you are using?
// App.tsx import * as React from 'react'; import {Button, View, Text} from 'react-native'; import {NavigationContainer} from '@react-navigation/native'; import {createNativeStackNavigator} from '@react-navigation/native-stack'; import PDFExample from './PdfViewer'; function HomeScreen({navigation}) { return ( <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> <Text>Home Screen</Text> <Button title="Go to Details" onPress={() => navigation.navigate('Details')} /> </View> ); } function DetailsScreen() { return <PDFExample />; } const Stack = createNativeStackNavigator(); function App() { return ( <NavigationContainer> <Stack.Navigator initialRouteName="Home"> <Stack.Screen name="Home" component={HomeScreen} /> <Stack.Screen name="Details" component={DetailsScreen} /> </Stack.Navigator> </NavigationContainer> ); } export default App; // PdfViewer.tsx import React from 'react'; import {StyleSheet, Dimensions, View} from 'react-native'; import Pdf from 'react-native-pdf'; export default class PDFExample extends React.Component { render() { const source = { uri: 'http://samples.leanpub.com/thereactnativebook-sample.pdf', cache: true, }; return ( <View style={styles.container}> <Pdf source={source} trustAllCerts={false} onLoadComplete={(numberOfPages, filePath) => { console.log(`Number of pages: ${numberOfPages}`); }} onPageChanged={(page, numberOfPages) => { console.log(`Current page: ${page}`); }} onError={error => { console.log(error); }} onPressLink={uri => { console.log(`Link pressed: ${uri}`); }} style={styles.pdf} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'flex-start', alignItems: 'center', marginTop: 25, }, pdf: { flex: 1, width: Dimensions.get('window').width, height: Dimensions.get('window').height, }, });
same issue, any update !
What
react-native
version are you using? 0.75.2What
react-native-pdf
version are you using? 6.7.5What platform does your issue occur on? (android/ios/both) android
Describe your issue as precisely as possible : Issue is occurring on 6.7.5 but not reproducible on 6.7.4. Repro:
react-native-pdf
andreact-navigation
boilerplateJoin a screenshot or video of the problem on the simulator or device?
Show us the code you are using?