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

ViewPropTypes has been removed from React Native

kris1803 opened this issue Β· comments

commented

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.

It talks about deprecated ViewPropTypes in 0.69 React native, they have even been removed from React Native so the app cannot start.

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..6dd3123 100644
--- a/node_modules/react-native-camera/src/RNCamera.js
+++ b/node_modules/react-native-camera/src/RNCamera.js
@@ -1,11 +1,11 @@
 // @flow
 import React from 'react';
 import PropTypes from 'prop-types';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import {
   findNodeHandle,
   Platform,
   NativeModules,
-  ViewPropTypes,
   requireNativeComponent,
   View,
   ActivityIndicator,

This issue body was partially generated by patch-package.

please include this in next version!

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.

It talks about deprecated ViewPropTypes in 0.69 React native, they have even been removed from React Native so the app cannot start.

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..6dd3123 100644
--- a/node_modules/react-native-camera/src/RNCamera.js
+++ b/node_modules/react-native-camera/src/RNCamera.js
@@ -1,11 +1,11 @@
 // @flow
 import React from 'react';
 import PropTypes from 'prop-types';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import {
   findNodeHandle,
   Platform,
   NativeModules,
-  ViewPropTypes,
   requireNativeComponent,
   View,
   ActivityIndicator,

This issue body was partially generated by patch-package.

commented

Is someone maintaining it?

opened a pull request #3442

I have followed and applied the fix but now I get a unhandled promise rejection now...did this occur or what RN version are you using?

@bearsworth if you are using RN >67 then go to build.gradle under app folder you will find a line
missingDimensionStrategy 'react-native-camera', 'general' change general to mlkit