You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native从0.63升级到0.72.4后Material Top Tabs报错

React Native 升级后 @react-navigation/material-top-tabs 页面出现 Clock 构造函数错误

问题详情

  • 项目从 React Native 0.63 版本升级至 0.72.4 版本后,仅在使用 @react-navigation/material-top-tabs(版本 ^6.6.5)的页面触发以下错误:
    ERROR TypeError: undefined is not a constructor (evaluating 'new Clock()')
    
  • 其余页面运行完全正常。
  • 尝试保留该库旧版本或升级至当前最新版本,iOS 端仍会出现相同错误。

package.json 内容

{"name": "Flakex",
  "version": "1.1.0",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@invertase/react-native-apple-authentication": "^2.2.1",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.19.3",
    "@react-native-clipboard/clipboard": "^1.11.1",
    "@react-native-community/blur": "^4.3.2",
    "@react-native-community/cli": "^11.3.8",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-firebase/app": "^18.5.0",
    "@react-native-firebase/auth": "^18.5.0",
    "@react-native-firebase/messaging": "^18.5.0",
    "@react-native-google-signin/google-signin": "^9.0.2",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.3",
    "@stripe/stripe-react-native": "^0.32.0",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^0.21.1",
    "firebase": "^10.4.0",
    "jetifier": "^2.0.0",
    "lottie-react-native": "^5.1.6",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.34",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-native": "^0.72.4",
    "react-native-animatable": "^1.3.3",
    "react-native-awesome-card-io": "^0.9.0",
    "react-native-aws3": "^0.0.9",
    "react-native-calendars": "^1.1301.0",
    "react-native-contacts": "^6.0.5",
    "react-native-countdown-component": "^2.7.1",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-credit-card-input-view": "^0.0.7",
    "react-native-date-picker": "^3.2.10",
    "react-native-deck-swiper": "^2.0.16",
    "react-native-device-info": "^10.6.0",
    "react-native-eject": "^0.2.0",
    "react-native-fast-image": "8.6.3",
    "react-native-fbsdk-next": "^9.0.0",
    "react-native-geocoder": "^0.5.0",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-get-random-values": "^1.7.2",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-google-mobile-ads": "^12.2.0",
    "react-native-google-places-autocomplete": "^2.5.1",
    "react-native-image-crop-picker": "^0.40.0",
    "react-native-linear-gradient": "^2.6.2",
    "react-native-localize": "^2.2.2",
    "react-native-location": "^2.5.0",
    "react-native-maps": "^1.7.1",
    "react-native-material-dropdown": "https://github.com/noway/react-native-material-dropdown",
    "react-native-progress-circle": "^2.1.0",
    "react-native-push-notification": "^8.1.1",
    "react-native-ratings": "^8.1.0",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-reanimated": "^3.5.4",
    "react-native-safe-area-context": "^4.7.2",
    "react-native-screens": "^3.25.0",
    "react-native-snap-carousel": "^1.3.1",
    "react-native-svg": "^12.1.1",
    "react-native-swiper-flatlist": "^3.0.16",
    "react-native-tab-view": "^2.16.0",
    "react-native-webview": "^11.23.1",
    "react-redux": "^7.2.5",
    "redux": "^4.1.1",
    "rn-faded-scrollview": "^1.0.10",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.23.2",
    "@babel/runtime": "^7.23.2",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^29.7.0",
    "eslint": "^7.21.0",
    "jest": "^29.7.0",
    "metro-react-native-babel-preset": "^0.65.2",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

补充信息

iOS模拟器界面显示上述错误信息。


内容的提问来源于stack exchange,提问作者vivek sharma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 08:14:52