react-native-swipeable
react-native-swipeable copied to clipboard
ViewPropTypes has been removed from React Native.
I'm getting this error from the lib using React Native v0.69.4
Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
My package.json dependencies:
"dependencies": { "@expo-google-fonts/inter": "^0.2.2", "@expo-google-fonts/poppins": "^0.2.2", "@gorhom/bottom-sheet": "4", "@react-native-async-storage/async-storage": "^1.17.9", "@react-navigation/drawer": "^6.4.3", "@react-navigation/native": "^6.0.11", "@react-navigation/native-stack": "^6.7.0", "@reduxjs/toolkit": "^1.8.4", "expo": "~46.0.3", "expo-auth-session": "~3.7.1", "expo-constants": "~13.2.3", "expo-crypto": "~11.0.0", "expo-dev-client": "~1.2.1", "expo-firebase-core": "~5.1.1", "expo-font": "^10.2.0", "expo-linking": "~3.2.2", "expo-random": "~12.3.0", "expo-splash-screen": "^0.16.1", "expo-status-bar": "~1.4.0", "expo-system-ui": "^1.3.0", "formik": "^2.2.9", "i18next": "^21.9.0", "intl": "^1.2.5", "intl-pluralrules": "^1.3.1", "native-base": "^3.4.11", "react": "18.0.0", "react-dom": "18.0.0", "react-i18next": "^11.18.3", "react-native": "0.69.4", "react-native-dotenv": "^3.3.1", "react-native-gesture-handler": "^2.5.0", "react-native-modal": "^13.0.1", "react-native-reanimated": "^2.9.1", "react-native-responsive-fontsize": "^0.5.1", "react-native-safe-area-context": "^4.3.1", "react-native-screens": "^3.15.0", "react-native-svg": "12.3.0", "react-native-swipeable": "^0.6.0", "react-native-uuid": "^2.0.1", "react-native-web": "^0.18.7", "react-redux": "^8.0.2", "redux": "^4.2.0", "rn-select-date-range": "^3.2.2", "victory-native": "^36.6.0", "yup": "^0.32.11" }, "devDependencies": { "@babel/core": "^7.18.10", "@types/intl": "^1.2.0", "@types/react": "^18.0.17", "@types/react-native": "^0.69.5", "@types/react-native-dotenv": "^0.2.0", "react-native-svg-transformer": "^1.0.0", "typescript": "^4.7.4" },
+1
For now you need to use the patch-package lib to apply a patch and adjust these calls from React Native to the deprecated view props lib
Here is how I applied the patch.
-
Import deprecated prop types in
index.js
with the following code:var _deprecatedPropTypes = require('deprecated-react-native-prop-types');
-
Now update the lines 606-612 of
index.js
as: