maps icon indicating copy to clipboard operation
maps copied to clipboard

ViewPropTypes will be removed from React Native.

Open ludvigeriksson opened this issue 2 years ago • 4 comments

This is a warning that appears in React Native 0.68, it seems rnmapbox imports this export which will be removed.

ludvigeriksson avatar May 20 '22 14:05 ludvigeriksson

It looks like the JS code has to be converted to TypeScript, but for now it should be sufficient to import ViewPropTypes from deprecated-react-native-prop-types

VolkerLieber avatar May 22 '22 14:05 VolkerLieber

RN 0.69 actually removed it, so this is now a fatal error instead of just a warning.

simon-abbott avatar Jun 29 '22 16:06 simon-abbott

@ludvigeriksson Could help to follow the steps you feel

  • install patch-package mode dev
  • add script "postinstall": "patch-package",
  • install deprecated-react-native-prop-types
  • make these changes to the file node_modules/@react-native-mapbox-gl/maps/javascript/utils/index.js
 import React from 'react';
 import {
-  ViewPropTypes,
-  View,
   NativeModules,
   findNodeHandle,
   Platform,
 } from 'react-native';
+import {ViewPropTypes} from 'deprecated-react-native-prop-types';

-export const viewPropTypes = ViewPropTypes || View.props;
+export const viewPropTypes = ViewPropTypes;
  • npm run patch-package @react-native-mapbox-gl/maps or yarn patch-package @react-native-mapbox-gl/maps

wootsbot avatar Jul 04 '22 22:07 wootsbot

patch-package also requires postinstall-postinstall with yarn: https://www.npmjs.com/package/patch-package#why-use-postinstall-postinstall-with-yarn

Pika-Pool avatar Jul 14 '22 04:07 Pika-Pool

Should be fixed in @rnmapbox/maps

mfazekas avatar Sep 16 '22 09:09 mfazekas