react-native icon indicating copy to clipboard operation
react-native copied to clipboard

ViewPropTypes Error in React Native 0.71 and Above

Open abhayb443 opened this issue 2 years ago • 5 comments

Description

ERROR ViewPropTypes will be removed from React Native, along with all other PropTypes. We recommend that you migrate away from PropTypes and switch to a type system like TypeScript. If you need to continue using ViewPropTypes, migrate to the 'deprecated-react-native-prop-types' package.

React Native Version

0.72.4

Output of npx react-native info

abhaypandey@Admins-MacBook-Air-81 ideopay-user-app-react % npx react-native info warn Package react-native-appsflyer contains invalid configuration: "dependency.platforms.ios.podspecPath" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. info Fetching system and libraries information... System: OS: macOS 14.0 CPU: (8) arm64 Apple M1 Memory: 152.84 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 19.3.0 path: ~/.nvm/versions/node/v19.3.0/bin/node Yarn: version: 1.22.19 path: ~/.nvm/versions/node/v19.3.0/bin/yarn npm: version: 9.2.0 path: ~/.nvm/versions/node/v19.3.0/bin/npm Watchman: version: 2023.10.09.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: version: 15.0.1/15A507 path: /usr/bin/xcodebuild Languages: Java: version: 11.0.20.1 path: /usr/bin/javac Ruby: version: 3.2.2 path: /opt/homebrew/opt/ruby/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.4 wanted: 0.72.4 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: Not found

Steps to reproduce

On upgrade of react native, I started seeing this error. No specific use case that gives this error. yarn add react-native

But i did notice that adding LogBox and warning removal code shared below, but didn't resolve this issue.

import { LogBox } from "react-native";

if (DEV) { const ignoreWarns = [ "EventEmitter.removeListener", "[fuego-swr-keys-from-collection-path]", "Setting a timer for a long period of time", "ViewPropTypes will be removed from React Native", "AsyncStorage has been extracted from react-native", "exported from 'deprecated-react-native-prop-types'.", "Non-serializable values were found in the navigation state.", "VirtualizedLists should never be nested inside plain ScrollViews", ];

const warn = console.warn; console.warn = (...arg) => { for (const warning of ignoreWarns) { if (arg[0].startsWith(warning)) { return; } } warn(...arg); };

LogBox.ignoreLogs(ignoreWarns); }

Also, I did started seeing this post add react-native-clarity of version 2.0.0, I think it was being used in this library.

Snack, screenshot, or link to a repository

image

abhayb443 avatar Nov 11 '23 20:11 abhayb443

:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

github-actions[bot] avatar Nov 11 '23 20:11 github-actions[bot]

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.72.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

github-actions[bot] avatar Nov 11 '23 20:11 github-actions[bot]

The issue still exist in new patch as well. Just verified the same. Had to add the patch inorder to avoid the same.

abhayb443 avatar Nov 11 '23 21:11 abhayb443

Sorry could you clarify what you expect to happen? Is it the fact that the warning is repeated consistently or the warning itself?

lunaleaps avatar Nov 13 '23 18:11 lunaleaps

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 12 '24 05:05 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar May 19 '24 05:05 github-actions[bot]