tokkozhin / react-native-neomorph-shadows

Shadows and neumorphism/neomorphism for iOS & Android (like iOS).
MIT License
788 stars 89 forks source link

fix the error about `Invariant Violation: ViewPropTypes has been removed from React Native` #63

Open fencer-yd opened 1 year ago

fencer-yd commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-neomorph-shadows@1.1.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-neomorph-shadows/package.json.orig b/node_modules/react-native-neomorph-shadows/package.json.orig
new file mode 100644
index 0000000..fc5e8ff
--- /dev/null
+++ b/node_modules/react-native-neomorph-shadows/package.json.orig
@@ -0,0 +1,53 @@
+{
+  "name": "react-native-neomorph-shadows",
+  "version": "1.1.2",
+  "description": "Shadows and neumorphism/neomorphism UI for iOS & Android (like iOS).",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "dependencies": {
+    "@react-native-community/art": "^1.2.0",
+    "prop-types": "^15.7.2"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/tokkozhin/react-native-neomorph-shadows.git"
+  },
+  "keywords": [
+    "react-native",
+    "react-component",
+    "react-native-component",
+    "react",
+    "react native",
+    "mobile",
+    "ios",
+    "android",
+    "ui",
+    "component",
+    "neomorph",
+    "neomorphism",
+    "neumorphism",
+    "skeuomorphic",
+    "skeuomorphism",
+    "shadowbox",
+    "shadow",
+    "shadow-view",
+    "shadowview",
+    "react-native-shadow",
+    "react-native-shadow-view",
+    "react-native-shadowview",
+    "react-native-neomorphism",
+    "react-native-neomorphism-view"
+  ],
+  "author": "Daniel Tokkozhin",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/tokkozhin/react-native-neomorph-shadows/issues"
+  },
+  "homepage": "https://github.com/tokkozhin/react-native-neomorph-shadows#readme",
+  "devDependencies": {
+    "@types/react": "^16.9.34",
+    "@types/react-native": "^0.62.7"
+  }
+}
diff --git a/node_modules/react-native-neomorph-shadows/src/types.js b/node_modules/react-native-neomorph-shadows/src/types.js
index a2098cc..adc0734 100644
--- a/node_modules/react-native-neomorph-shadows/src/types.js
+++ b/node_modules/react-native-neomorph-shadows/src/types.js
@@ -1,4 +1,4 @@
-import { ViewPropTypes } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import { number, shape, string, node, bool } from 'prop-types';

 export const ShadowARTType = {

This issue body was partially generated by patch-package.

JapeshFlyFin commented 1 year ago

I'm facing same issue, is there any plan to implement this fix?

VishalRowth commented 1 year ago

same Soution Please?

mbpictures commented 1 year ago

@VishalRowth the last version has been published 3 years ago. The solution to fix it is provided in the issue description. Install patch-package, modify the files as described above (node_modules/react-native-neomorph-shadows/src/types.js), and run patch-package to patch the react-native-neomorph-shadows package.

sam-uraii commented 11 months ago

Thanks a lot!!!