Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve Invariant Violation error by switching to deprecated-react-native-prop-types version of ViewPropTypes #30

Open
skaramicke opened this issue Jan 21, 2023 · 0 comments · May be fixed by #31

Comments

@skaramicke
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I was getting an Invariant Violation error.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-pinch-zoom-view/index.js b/node_modules/react-native-pinch-zoom-view/index.js
index da7d6c4..d98595c 100644
--- a/node_modules/react-native-pinch-zoom-view/index.js
+++ b/node_modules/react-native-pinch-zoom-view/index.js
@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-import { View, StyleSheet, PanResponder, ViewPropTypes } from 'react-native';
+import { View, StyleSheet, PanResponder } from 'react-native';
+import ViewPropTypes from 'deprecated-react-native-prop-types';
 
 // Fallback when RN version is < 0.44
 const viewPropTypes = ViewPropTypes || View.propTypes;

This issue body was partially generated by patch-package.

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

Successfully merging a pull request may close this issue.

1 participant