I trying to setup my path alias in React Native. I added needed paths into tsconfig and babel.config:
tsconfig:
{"extends": "expo/tsconfig.base","compilerOptions": {"strict": true,"jsx": "react-native","target": "ESNext","allowSyntheticDefaultImports": true,"skipLibCheck": true,"baseUrl": ".","paths": {"@app/*": ["src/*"],"@assets/*": ["assets/*"], } }}
and babel.config:
module.exports = function (api) { api.cache(true); return { presets: ['babel-preset-expo'], plugins: [ ['module-resolver', { extensions: ['.tsx', '.ts', '.js', '.json'], root: '.', alias: {'@app': './src','@assets': './assets', }, }, ], ], };};
But it trying to resolve my paths such way: Unable to resolve "./src/*/hooks/useAppFonts" from "App.tsx"
.
What have I done wrong?