githuboftigran / rn-range-slider

A native slider with range
MIT License
234 stars 130 forks source link

ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. #124

Closed yao-charlie closed 1 year ago

yao-charlie commented 2 years ago

In title. Updated a bunch of my dependencies and it seems this will be deprecated from RN soon.

P.S. not a regular dev so I apologize if this isn't a standard/polite way of advising of a potential issue :)

ptreitler commented 2 years ago

Ran into the same issue after an update to "react-native": "0.69.1".

Now it is no longer a warning but an error:

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

Workaround until this is fixed: https://stackoverflow.com/a/72836507/1746379

gregoriusjimmy commented 1 year ago

Ran into the same issue after an update to "react-native": "0.69.1".

Now it is no longer a warning but an error:

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

Workaround until this is fixed: https://stackoverflow.com/a/72836507/1746379

mine too

fahad86 commented 1 year ago

used patch-package to patch rn-range-slider@2.1.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/rn-range-slider/index.js b/node_modules/rn-range-slider/index.js
index c054f07..c124ecc 100644
--- a/node_modules/rn-range-slider/index.js
+++ b/node_modules/rn-range-slider/index.js
@@ -1,5 +1,6 @@
 import React, { memo, useState, useEffect, useCallback, useMemo, useRef } from 'react';
-import { Animated, PanResponder, View, ViewPropTypes } from 'react-native';
+import { Animated, PanResponder, View } from 'react-native';
+import {ViewPropTypes} from 'deprecated-react-native-prop-types';
 import PropTypes from 'prop-types';

 import styles from './styles';
githuboftigran commented 1 year ago

Fixed this in 2.2.1