RN: 0.45.1 React: 16.0.0-alpha.12 NativeBase: 2.2.0
Since NativeBase has its type definitions file within it (node_modules/native-base/index.d.ts) my IDE should be able to resolve imported components. All of my other dependencies can be resolved by PhpStorm without any problem, like: React, React-Native, Redux, propTypes etc.
When I use following statement in my IDE (phpStorm)
import { connectStyle, Button, Text } from 'native-base';
I get: Cannot resolve symbol error for all the components imported.
Create a new project on PhpStorm with React, ReactNative and NativeBase. Then add the following import statement to any JS file.
import { connectStyle, Button, Text } from 'native-base';
N/A
N/A
N/A
+1
+1
+1
For a temporary fix.
In \node_modules\native-base\index.d.ts: comment the imports:
//import * as React from "react";
//import * as ReactNative from "react-native";
declare module "native-base" {
@darkopetrovic Thank you so much. This worked.
It works, thx
thanks, works
Any updates? The solution, as is says, is "temporary". Every time yarn / npm runs the fix is removed from the file.
Edit; or is this an Intellij / Webstorm / Phpstorm /... issue?
@darkopetrovic It works!
This temporary fix might be a PR ;)
@darkopetrovic thanks a lot. I fix it finally, that confuced me a lot before.
https://github.com/GeekyAnts/NativeBase/issues/1075#issuecomment-321543488
Actually, this fix does not fix the problem fully. Imports begin working, but instead it breaks ability of IDE to suggest properties that inherited from base ReactNative components
Guys, any progress here?
This is really annoying bug.
Fixed with NB 2.3.10
Most helpful comment
For a temporary fix.
In
\node_modules\native-base\index.d.ts:comment the imports:https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000489950-JavaScript-Modules-with-Namespaces-Cannot-resolve-symbol