4

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

1
  • Hey do you have the solution? Commented Sep 30, 2024 at 17:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.