Uncaught TypeError: (0 , _reactNative.requireNativeComponent) is not a function

149 Views Asked by At

My website used react-native-web and I am getting the following error when I am importing Alert or WarningOutlineIcon from native base

Error

Uncaught TypeError: (0 , _reactNative.requireNativeComponent) is not a function
    at eval (NativeComponents.js:1:1)
    at ./node_modules/react-native-svg/lib/module/elements/NativeComponents.js (main.js:13358:1)
    at __webpack_require__ (main.js:20091:33)
    at fn (main.js:20303:21)
    at eval (Rect.js:1:1)
    at ./node_modules/react-native-svg/lib/module/elements/Rect.js (main.js:13418:1)
    at __webpack_require__ (main.js:20091:33)
    at fn (main.js:20303:21)
    at eval (ReactNativeSVG.js:1:1)
    at ./node_modules/react-native-svg/lib/module/ReactNativeSVG.js 

Import statement

import {Alert} from "native-base";
import {WarningOutlineIcon} from "native-base";

Package.json vs for react-native

"react-native": "^0.70.1",
"react-native-dropdown-picker": "5.4.7-beta.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-svg": "^12.1.1",
"react-native-web": "^0.18.12",

I tried cleaning node_modules and npm install react-native-svg but it doesn't work

0

There are 0 best solutions below