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

This issue has been tracked since 2022-09-14.

Description

I have searched the whole repository. But I couldn't find ViewPropTypes anywhere in the project.

// Deprecated Prop Types
  get ColorPropType(): $FlowFixMe {
    invariant(
      false,
      'ColorPropType has been removed from React Native. Migrate to ' +
      "ColorPropType exported from 'deprecated-react-native-prop-types'.",
    );
  },
  get EdgeInsetsPropType(): $FlowFixMe {
    invariant(
      false,
      'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
      "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
    );
  },
  get PointPropType(): $FlowFixMe {
    invariant(
      false,
      'PointPropType has been removed from React Native. Migrate to ' +
      "PointPropType exported from 'deprecated-react-native-prop-types'.",
    );
  },
  get ViewPropTypes(): $FlowFixMe {
    invariant(
      false,
      'ViewPropTypes has been removed from React Native. Migrate to ' +
      "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
    );
  },

Use this in node_modules -> react-native -> index.js

Version

0.70

Output of npx react-native info

System:
OS: macOS 12.2.1
CPU: (8) arm64 Apple M1 Pro
Memory: 95.16 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 18.4.0 - /opt/homebrew/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 8.12.1 - /opt/homebrew/bin/npm
Watchman: 2022.06.06.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.70.0 => 0.70.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

When building the project

Snack, code example, screenshot, or link to a repository

Screenshot 2022-09-14 at 15 44 20

danilobuerger wrote this answer on 2022-09-14

If you share a reproducible repository, I would take a look.

Almas-Asghar-730 wrote this answer on 2022-09-18

Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
having the same issue is their any solution?

Bayramito wrote this answer on 2022-09-18

i actually applied the solution by adding deprecated-react-native-prop-types to the app but somehow external modules did not get effected from that. so result is, every external lib which used ViewPropTypes from react-native still keep crashing and need to be patched one by one.

HSReact wrote this answer on 2022-09-19

Have the same problem

alexkendall wrote this answer on 2022-09-20

Same problem. Swapped deprecated-react-native-prop-types in my code and can't find ViewPropTypes anywhere in the project.

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-10-03
Star Count 105144
Watcher Count 3666
Fork Count 22469
Issue Count 2232

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date