react-native-camera / react-native-camera

A Camera component for React Native. Also supports barcode scanning!

Home Page:https://react-native-camera.github.io/react-native-camera/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'., js engine: hermes

Jeopardous opened this issue Β· comments

Hi! πŸ‘‹

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

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

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-camera/src/RNCamera.js b/node_modules/react-native-camera/src/RNCamera.js
index b7a271a..61ac38f 100644
--- a/node_modules/react-native-camera/src/RNCamera.js
+++ b/node_modules/react-native-camera/src/RNCamera.js
@@ -5,7 +5,7 @@ import {
   findNodeHandle,
   Platform,
   NativeModules,
-  ViewPropTypes,
+  // ViewPropTypes,
   requireNativeComponent,
   View,
   ActivityIndicator,
@@ -394,7 +394,7 @@ export default class Camera extends React.Component<PropsType, StateType> {
   };
 
   static propTypes = {
-    ...ViewPropTypes,
+    // ...ViewPropTypes,
     zoom: PropTypes.number,
     useNativeZoom: PropTypes.bool,
     maxZoom: PropTypes.number,

This issue body was partially generated by patch-package.