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

I am getting below error while I using in my react native app #208

Open
singhsaurabh920 opened this issue Sep 29, 2023 · 4 comments
Open

Comments

@singhsaurabh920
Copy link

singhsaurabh920 commented Sep 29, 2023

ERROR ViewPropTypes will be removed from React Native, along with all other PropTypes. We recommend that you migrate away from PropTypes and switch to a type system like TypeScript. If you need to continue using ViewPropTypes, migrate to the 'deprecated-react-native-prop-types' package.
at MainStackNavigator
at EnsureSingleNavigator (http://localhost:8081/index.bundle?

@stolenfallen1
Copy link

Hi, have you tried installing the deprecated react native prop types package? This did it for me. I don't think there is any other way around.

npm install deprecated-react-native-prop-types 

or

yarn add deprecated-react-native-prop-types

@sayancitytech
Copy link

First install deprecated-react-native-prop-types then
add import { ViewPropTypes } from 'deprecated-react-native-prop-types'; in \node_modules\react-native-slider\src\Slider.js
then yarn patch-package react-native-slider

@cscouto
Copy link

cscouto commented Sep 4, 2024

diff --git a/node_modules/react-native-slider/src/Slider.js b/node_modules/react-native-slider/src/Slider.js
index 37deee5..0db3112 100644
--- a/node_modules/react-native-slider/src/Slider.js
+++ b/node_modules/react-native-slider/src/Slider.js
@@ -11,7 +11,7 @@ import {
   PanResponder,
   View,
   Easing,
-  ViewPropTypes
+  ViewStyle
 } from "react-native";
 
 import PropTypes from 'prop-types';
@@ -131,17 +131,17 @@ export default class Slider extends PureComponent {
     /**
      * The style applied to the slider container.
      */
-    style: ViewPropTypes.style,
+    style: ViewStyle,
 
     /**
      * The style applied to the track.
      */
-    trackStyle: ViewPropTypes.style,
+    trackStyle: ViewStyle,
 
     /**
      * The style applied to the thumb.
      */
-    thumbStyle: ViewPropTypes.style,
+    thumbStyle: ViewStyle,
 
     /**
      * Sets an image for the thumb.

@cscouto
Copy link

cscouto commented Sep 4, 2024

use the patch above to fix the issue

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