I tried to use module imports for a directory in React Native using tsconfig paths, but it gave me this error:
This is how I imported it:
import Router from "@navigation/Router"
VSCode didn't give me any error.
And this is the tsconfig.json:
{"compilerOptions": {"target": "esnext","module": "commonjs","lib": ["es2017"],"allowJs": true,"jsx": "react-native","noEmit": true,"isolatedModules": true,"strict": true,"moduleResolution": "node","baseUrl": ".","paths": {"@navigation/*": ["src/screens/_navigation/*"] },"allowSyntheticDefaultImports": true,"esModuleInterop": true,"skipLibCheck": false },"exclude": ["node_modules","babel.config.js","metro.config.js","jest.config.js" ]}
I found others similar questions but their answers didn't work.
Do someone know why it doesn't work?
Thanks in advance!