HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
235 stars 67 forks source link

FIX add deprecated-react-native-prop-types library for react-native-hms-map #243

Closed Splicer97 closed 1 year ago

Splicer97 commented 1 year ago

In version react-native above 0.68 Facebook deleted ViewPropTypes from react-native. I add deprecated-react-native-prop-types package dependency and tested it in "react-native": "0.69.3" and that's work

bakiinitialcode commented 1 year ago

Thanks for the fix. Any information on when it will be merged and published? We are getting this error and waiting for it to be fixed to release a version.

Splicer97 commented 1 year ago

Thanks for the fix. Any information on when it will be merged and published? We are getting this error and waiting for it to be fixed to release a version.

You can use my fork for huawei maps if you want yarn add Splicer97/react-native-hms-map

Splicer97 commented 1 year ago

@ozcanozgur can you check it PR please?

next6leo commented 1 year ago

@ozkulbeng @ozcanozgur bump has this merge into master?

MateuszRostkowski commented 1 year ago

@next6leo As a workaround for now you can add patch (use patch-package for this).

Create file: patches/@hmscore+react-native-hms-map+6.3.1-305.patch:

diff --git a/node_modules/@hmscore/react-native-hms-map/src/CircleView.js b/node_modules/@hmscore/react-native-hms-map/src/CircleView.js
index 0555718..858b66c 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/CircleView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/CircleView.js
@@ -16,7 +16,8 @@

 import { exact, oneOf, number, arrayOf, bool, func, oneOfType } from "prop-types";
 import React, { Component } from "react";
-import { requireNativeComponent, ViewPropTypes } from "react-native";
+import { requireNativeComponent } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import { PatternItemTypes } from "./constants";

 class HMSCircleView extends Component {
diff --git a/node_modules/@hmscore/react-native-hms-map/src/GroundOverlayView.js b/node_modules/@hmscore/react-native-hms-map/src/GroundOverlayView.js
index 9d4d08f..7d54d1b 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/GroundOverlayView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/GroundOverlayView.js
@@ -25,7 +25,8 @@ import {
   arrayOf,
 } from "prop-types";
 import React, { Component } from "react";
-import { requireNativeComponent, ViewPropTypes } from "react-native";
+import { requireNativeComponent } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';

 class HMSGroundOverlayView extends Component {
   constructor() {
diff --git a/node_modules/@hmscore/react-native-hms-map/src/InfoWindowView.js b/node_modules/@hmscore/react-native-hms-map/src/InfoWindowView.js
index f8b4d59..a540705 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/InfoWindowView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/InfoWindowView.js
@@ -15,7 +15,8 @@
 */

 import React, { Component } from "react";
-import { requireNativeComponent, ViewPropTypes, View } from "react-native";
+import { requireNativeComponent, View } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';

 class HMSInfoWindowView extends Component {
   constructor() {
diff --git a/node_modules/@hmscore/react-native-hms-map/src/MapView.js b/node_modules/@hmscore/react-native-hms-map/src/MapView.js
index aa705fa..ec6b16f 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/MapView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/MapView.js
@@ -21,8 +21,8 @@ import {
   requireNativeComponent,
   UIManager,
   NativeModules,
-  ViewPropTypes,
 } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';

 const { HMSMapViewModule } = NativeModules;

diff --git a/node_modules/@hmscore/react-native-hms-map/src/MarkerView.js b/node_modules/@hmscore/react-native-hms-map/src/MarkerView.js
index 5f65f76..bbd0925 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/MarkerView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/MarkerView.js
@@ -20,8 +20,8 @@ import {
   findNodeHandle,
   requireNativeComponent,
   UIManager,
-  ViewPropTypes,
 } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';

 class HMSMarkerView extends Component {
   constructor() {
diff --git a/node_modules/@hmscore/react-native-hms-map/src/PolygonView.js b/node_modules/@hmscore/react-native-hms-map/src/PolygonView.js
index 821116e..63e0368 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/PolygonView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/PolygonView.js
@@ -16,7 +16,8 @@

 import { exact, oneOf, number, arrayOf, bool, func, oneOfType } from "prop-types";
 import React, { Component } from "react";
-import { requireNativeComponent, ViewPropTypes } from "react-native";
+import { requireNativeComponent } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import { PatternItemTypes } from "./constants";

 class HMSPolygonView extends Component {
diff --git a/node_modules/@hmscore/react-native-hms-map/src/PolylineView.js b/node_modules/@hmscore/react-native-hms-map/src/PolylineView.js
index 345909b..72da911 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/PolylineView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/PolylineView.js
@@ -16,7 +16,8 @@

 import { string, exact, oneOf, number, arrayOf, bool, func, oneOfType } from "prop-types";
 import React, { Component } from "react";
-import { requireNativeComponent, ViewPropTypes } from "react-native";
+import { requireNativeComponent } from "react-native";
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
 import { PatternItemTypes, CapTypes, JointTypes } from "./constants";

 class HMSPolylineView extends Component {
diff --git a/node_modules/@hmscore/react-native-hms-map/src/TileOverlayView.js b/node_modules/@hmscore/react-native-hms-map/src/TileOverlayView.js
index a9fda6d..6842def 100644
--- a/node_modules/@hmscore/react-native-hms-map/src/TileOverlayView.js
+++ b/node_modules/@hmscore/react-native-hms-map/src/TileOverlayView.js
@@ -16,7 +16,8 @@

 import { number, bool, exact, string, oneOfType, arrayOf } from 'prop-types';
 import React, { Component } from 'react';
-import { findNodeHandle, requireNativeComponent, UIManager, ViewPropTypes } from 'react-native';
+import { findNodeHandle, requireNativeComponent, UIManager } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';

 class HMSTileOverlayView extends Component {
   constructor() {