wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.6k stars 557 forks source link

ProgressViewIOS is depreciated #824

Open FurqanSkylinx opened 7 months ago

FurqanSkylinx commented 7 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-pdf@5.1.7 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-pdf/index.js b/node_modules/react-native-pdf/index.js
index 85b2a94..a9a42ec 100644
--- a/node_modules/react-native-pdf/index.js
+++ b/node_modules/react-native-pdf/index.js
@@ -13,8 +13,8 @@ import {
     requireNativeComponent,
     View,
     Platform,
-    ProgressBarAndroid,
-    ProgressViewIOS,
+
+
     ViewPropTypes,
     StyleSheet
 } from 'react-native';
@@ -24,6 +24,7 @@ import RNFetchBlob from 'rn-fetch-blob';
 const SHA1 = require('crypto-js/sha1');
 import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
 import PdfView from './PdfView';
+import { ProgressView } from '@react-native-community/progress-view';

 export default class Pdf extends Component {

@@ -375,14 +376,14 @@ export default class Pdf extends Component {
                                 {this.props.activityIndicator
                                     ? this.props.activityIndicator
                                     : Platform.OS === 'android'
-                                        ? <ProgressBarAndroid
+                                        ? <ProgressView
                                             progress={this.state.progress}
                                             indeterminate={false}
                                             styleAttr="Horizontal"
                                             style={styles.progressBar}
                                             {...this.props.activityIndicatorProps}
                                         />
-                                        : <ProgressViewIOS
+                                        : <ProgressView
                                             progress={this.state.progress}
                                             style={styles.progressBar}
                                             {...this.props.activityIndicatorProps}

This issue body was partially generated by patch-package.