Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

ViewPropTypes has been removed from React Native #384

Open
AhmadHussain755 opened this issue Jul 14, 2022 · 10 comments
Open

ViewPropTypes has been removed from React Native #384

AhmadHussain755 opened this issue Jul 14, 2022 · 10 comments

Comments

@AhmadHussain755
Copy link

What's happening?

How can it be reproduced?

Build details?

@supriyoMondal
Copy link

This issue is caused by react-native-camera .

@Aarvis
Copy link

Aarvis commented Jul 17, 2022

This issue is caused by react-native-camera .

Yes, I got this issue and temporarily followed this fix suggested in react-native-camera issues bucket
react-native-camera/react-native-camera#3423

Works smooth now

@DanielGBullido
Copy link

Hi

you need to use https://github.com/mrousavy/react-native-vision-camera beacuse react-native-camera/react-native-camera#3423 is deprecated.

please update your repo to use react-native-vision-camera

@Legion2
Copy link

Legion2 commented Aug 19, 2022

We updated to react-native 0.69.4 and now our app wont start because react-native-camera which is an unmaintained dependency of this project uses the removed ViewPropTypes of react-native. The only path forward is to replace react-native-camera with react-native-vision-camera.

@aapa96
Copy link

aapa96 commented Aug 31, 2022

How can I use this library with react native vision camera

@fdelavra
Copy link

Any news about this? Using a non maintained package is not possible ;)

@zfy171
Copy link

zfy171 commented Sep 15, 2022

我也有同样问题 如何手动修改不可维护包 是不是不太科学

@RickReac
Copy link

You can use the deprecated-react-native-prop-types with
npm install deprecated-react-native-prop-types --save.

Had to do some hacking in node_modules/react-native-camera/src/RNCamera.js:

  1. Remove the ViewPropTypes from the original compound import statement.
  2. Add import { ViewPropTypes } from 'deprecated-react-native-prop-types'; right above import PropTypes

I know it's not the clean/right/correct/recommended way to fix this, But if you need a quick solution, this may help.

@CostachescuCristinel
Copy link

  1. npm install deprecated-react-native-prop-types or yarn add deprecated-react-native-prop-types
  2. Add "postinstall": "patch-package" to <your-project-root>/package.json in "scripts"
  3. Add the patch file in <your-project-root>/patches
  4. npm install or yarn your project

react-native-camera+4.2.1.patch

NOTE: This patch adds deprecated-react-native-prop-types@^2.3.0 as a react-native-camera dependency in its package.json, however, I cannot get it to actually install it automatically.
diff --git a/node_modules/react-native-camera/package.json b/node_modules/react-native-camera/package.json
index 5e2dc63..cea2a2d 100644
--- a/node_modules/react-native-camera/package.json
+++ b/node_modules/react-native-camera/package.json
@@ -9,7 +9,8 @@
     "logo": "https://opencollective.com/opencollective/logo.txt"
   },
   "dependencies": {
-    "prop-types": "^15.6.2"
+    "prop-types": "^15.6.2",
+	"deprecated-react-native-prop-types": "^2.3.0"
   },
   "devDependencies": {
     "@babel/runtime": "^7.3.1",
diff --git a/node_modules/react-native-camera/src/RNCamera.js b/node_modules/react-native-camera/src/RNCamera.js
index b7a271a..9408751 100644
--- a/node_modules/react-native-camera/src/RNCamera.js
+++ b/node_modules/react-native-camera/src/RNCamera.js
@@ -5,7 +5,6 @@ import {
   findNodeHandle,
   Platform,
   NativeModules,
-  ViewPropTypes,
   requireNativeComponent,
   View,
   ActivityIndicator,
@@ -13,6 +12,7 @@ import {
   StyleSheet,
   PermissionsAndroid,
 } from 'react-native';
+import { ViewPropTypes } from "deprecated-react-native-prop-types";
 
 import type { FaceFeature } from './FaceDetector';
 

@SaadBazaz
Copy link

Any plans on migrating this cool library to React Native Vision Camera? We've updated React Native and now the app crashes because of the deprecation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests