Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React Native (Typescript) Absolute path unable to resolve module

$
0
0

I have just created a new project and I am trying to setup an absolute path by following this post: https://medium.com/geekculture/making-life-easier-with-absolute-imports-react-in-javascript-and-typescript-bbdab8a8a3a1

I have followed the steps as close as I can but can not get this to work in my simulator. (Visually there are no errors when looking at my code in IDE)

Terminal error

eslint-config.json

{"eslintConfig": {"extends": ["react-app", "airbnb"],"settings": {"import/resolver": {"node": {"paths": ["src"],"extensions": [".js", ".jsx", ".ts", ".tsx"]        }      }    }  }}

tsconfig.json

{"extends": "@tsconfig/react-native/tsconfig.json",     /* Recommended React Native TSConfig base */"compilerOptions": {"skipLibCheck": true,                                 /* Skip type checking all .d.ts files. */"baseUrl": "src",  },}

In this image you can see my file structure, the error on my simulator. And how I am importing it.

enter image description here

I have two exported functions in my Text.tsxexport function Title&export function P

Any help is appreciated... Thank you!


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>