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

Fix ViewPropTypes #81

Open
amornpic opened this issue Sep 7, 2022 · 3 comments
Open

Fix ViewPropTypes #81

amornpic opened this issue Sep 7, 2022 · 3 comments

Comments

@amornpic
Copy link

amornpic commented Sep 7, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-snackbar-component@1.1.12 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-snackbar-component/index.js b/node_modules/react-native-snackbar-component/index.js
index ae1e313..96d4fc5 100644
--- a/node_modules/react-native-snackbar-component/index.js
+++ b/node_modules/react-native-snackbar-component/index.js
@@ -5,8 +5,8 @@ import {
   Text,
   Animated,
   Easing,
-  ViewPropTypes,
 } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import { Touchable } from './src';
 
 /* Values are from https://material.io/guidelines/motion/duration-easing.html#duration-easing-dynamic-durations */
diff --git a/node_modules/react-native-snackbar-component/src/Touchable.js b/node_modules/react-native-snackbar-component/src/Touchable.js
index 0b08723..f5a6bbc 100644
--- a/node_modules/react-native-snackbar-component/src/Touchable.js
+++ b/node_modules/react-native-snackbar-component/src/Touchable.js
@@ -4,8 +4,8 @@ import {
   View,
   TouchableOpacity,
   TouchableNativeFeedback,
-  ViewPropTypes,
 } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import {
   IS_ANDROID,
   IS_LT_LOLLIPOP,

This issue body was partially generated by patch-package.

@andres-torres-marroquin
Copy link

Definitely this fixes the issue

@JapeshFlyFin
Copy link

Hey guys any plans to implement this fix?

@Liquid2Sky
Copy link

The patch fixes the problem only partially, there are more deprecated PropTypes in use.

diff --git a/node_modules/react-native-snackbar-component/index.js b/node_modules/react-native-snackbar-component/index.js
index ae1e313..7cc710f 100644
--- a/node_modules/react-native-snackbar-component/index.js
+++ b/node_modules/react-native-snackbar-component/index.js
@@ -2,11 +2,10 @@ import React, { Component } from 'react';
 import PropTypes from 'prop-types';
 import {
   StyleSheet,
-  Text,
   Animated,
   Easing,
-  ViewPropTypes,
 } from 'react-native';
+import { ViewPropTypes, TextPropTypes } from 'deprecated-react-native-prop-types';
 import { Touchable } from './src';
 
 /* Values are from https://material.io/guidelines/motion/duration-easing.html#duration-easing-dynamic-durations */
@@ -192,8 +191,8 @@ SnackbarComponent.propTypes = {
   // eslint-disable-next-line react/no-unused-prop-types
   autoHidingTime: PropTypes.number, // How long (in milliseconds) the snack bar will be hidden.
   containerStyle: ViewPropTypes.style,
-  messageStyle: Text.propTypes.style,
-  actionStyle: Text.propTypes.style,
+  messageStyle: TextPropTypes.style,
+  actionStyle: TextPropTypes.style,
 };
 
 const styles = StyleSheet.create({
diff --git a/node_modules/react-native-snackbar-component/src/Touchable.js b/node_modules/react-native-snackbar-component/src/Touchable.js
index 0b08723..f5a6bbc 100644
--- a/node_modules/react-native-snackbar-component/src/Touchable.js
+++ b/node_modules/react-native-snackbar-component/src/Touchable.js
@@ -4,8 +4,8 @@ import {
   View,
   TouchableOpacity,
   TouchableNativeFeedback,
-  ViewPropTypes,
 } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import {
   IS_ANDROID,
   IS_LT_LOLLIPOP,

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

No branches or pull requests

4 participants