簡體   English   中英

react-native-picker 不適用於 react-native 版本 0.63.2

[英]react-native-picker not working on react-native version 0.63.2

我將 react-native 版本升級到0.63.2 然后我在 Android 應用程序上遇到問題。

Android 應用顯示空白屏幕。

錯誤如下:

Warning: Picker has been extracted from react-native core and will be removed in a future release. 
It can now be installed and imported from '@react-native-community/picker' instead of 'react-native'. 
See https://github.com/react-native-community/react-native-picker
ERROR    TypeError: Super expression must either be null or a function
ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

我怎么解決這個問題?

Picker 已從“react-native”安裝庫@react-native-picker/picker中移除

代替

import {Picker} from 'react-native';

import {Picker} from '@react-native-picker/picker';

現在有幾天沒有使用 React Native 包,大多數包遷移到 React Native 社區。 對於您的問題,請使用以下步驟刪除節點模塊並使用 React Native 社區重新安裝它,

  • react-native 取消鏈接
  • npm 取消鏈接 npm
  • uninstall --save <模塊名稱。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM