简体   繁体   中英

Attempted import error: 'createElement' is not exported from 'react-native'. @react-native-picker/picker/js/Picker.web.js

Following error is being thrown while trying to use @react-native-picker\/picker in a react-native-web application.

"@react-native-picker/picker": "^1.16.1",
"babel-plugin-react-native-web": "^0.17.0",
"customize-cra": "^1.0.0",
"react-app-rewired": "^2.1.8"
"react": "16.9.0",
"react-dom": "16.9.0",
"react-native-web": "^0.15.7"


I'm using react-native version 0.61.5

Hi, This error costed me a hackathon win !<\/strong>

if you go and check picker.web.js file createElement is used something like this.

const createElement = ReactNativeWeb.createElement || ReactNativeWeb.unstable_createElement; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM