facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
116.48k stars 24.01k forks source link

ViewPropTypes Error in React Native 0.71 and Above #41422

Closed abhayb443 closed 2 weeks ago

abhayb443 commented 6 months ago

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:

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
github-actions[bot] commented 6 months ago
: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] commented 6 months ago
: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.
abhayb443 commented 6 months ago

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

lunaleaps commented 6 months ago

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

github-actions[bot] commented 3 weeks ago

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] commented 2 weeks ago

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