react-native-PDFView icon indicating copy to clipboard operation
react-native-PDFView copied to clipboard

Deprecated ViewPropTypes

Open cninov opened this issue 2 years ago • 4 comments

Hi! 👋

In RN 0.69 ViewPropTypes are deprecated. https://github.com/facebook/react-native/commit/badd30885fb999124b6b54b3fb016edbd988c16b

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-view-pdf/lib/RNPDFView.js b/node_modules/react-native-view-pdf/lib/RNPDFView.js
index 99b0241..a6193ee 100644
--- a/node_modules/react-native-view-pdf/lib/RNPDFView.js
+++ b/node_modules/react-native-view-pdf/lib/RNPDFView.js
@@ -1,4 +1,5 @@
-import { requireNativeComponent, ViewPropTypes } from 'react-native';
+import { requireNativeComponent } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import PropTypes from 'prop-types';
 
 
diff --git a/node_modules/react-native-view-pdf/lib/RNPDFView.js.flow b/node_modules/react-native-view-pdf/lib/RNPDFView.js.flow
index 99b0241..a6193ee 100644
--- a/node_modules/react-native-view-pdf/lib/RNPDFView.js.flow
+++ b/node_modules/react-native-view-pdf/lib/RNPDFView.js.flow
@@ -1,4 +1,5 @@
-import { requireNativeComponent, ViewPropTypes } from 'react-native';
+import { requireNativeComponent } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import PropTypes from 'prop-types';
 
 
diff --git a/node_modules/react-native-view-pdf/package.json b/node_modules/react-native-view-pdf/package.json
index 9b38139..af43c8c 100644
--- a/node_modules/react-native-view-pdf/package.json
+++ b/node_modules/react-native-view-pdf/package.json
@@ -57,7 +57,9 @@
     "ReactNativeViewPDF/*.h",
     "ReactNativeViewPDF/*.m"
   ],
-  "dependencies": {},
+  "dependencies": {
+     "deprecated-react-native-prop-types": "^2.3.0"
+  },
   "repository": {
     "type": "git",
     "url": "git+ssh://[email protected]/rumax/react-native-PDFView.git"
diff --git a/node_modules/react-native-view-pdf/src/RNPDFView.js b/node_modules/react-native-view-pdf/src/RNPDFView.js
index 99b0241..a6193ee 100644
--- a/node_modules/react-native-view-pdf/src/RNPDFView.js
+++ b/node_modules/react-native-view-pdf/src/RNPDFView.js
@@ -1,4 +1,5 @@
-import { requireNativeComponent, ViewPropTypes } from 'react-native';
+import { requireNativeComponent } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import PropTypes from 'prop-types';
 
 

 
 

cninov avatar Jun 29 '22 13:06 cninov

Any updates here, this breaks this library when using RN v0.69, I can add a PR to simply use deprecated package but I guess better solution would be to remove PropTypes

saransh-malik avatar Jul 13 '22 08:07 saransh-malik

Will be fixed with migration to TS, https://github.com/rumax/react-native-PDFView/pull/230. For now you can ignore it, right?

rumax avatar Jul 20 '22 07:07 rumax

Any timeline when fix will be Released ?

jalanvikas avatar Jul 25 '22 11:07 jalanvikas

This is now a blocker when trying to upgrade react-native to 0.69 version. Is there any way to get a quick fix like the one proposed above?

ndlonghi avatar Aug 05 '22 14:08 ndlonghi

Fixed in 0.14.0

rumax avatar Aug 15 '22 18:08 rumax