I'm trying to use typescript path mapping to improve my imports. But I have an error:
@UI/MainHeader could not be found within the project or in these directories:node_modules
So I updated my tsconfig
..."baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */"paths": {"@UI/*": ["./src/view/UI/*" ],"@components/*": ["./src/view/components/*" ],"@icons/*": ["./src/view/icons/*" ] },...
And also updated babel.config with module resolver plugin.
module.exports = function (api) { api.cache(true); return { presets: ['module:metro-react-native-babel-preset'], plugins: [ ['module-resolver'], { extensions: ['.js','.jsx','.ts','.tsx','android.js','android.tsx','ios.js','ios.tsx', ], root: ['./'], alias: {'@UI/*': ['./src/view/UI/*'],'@components/*': ['./src/view/components/*'],'@icons/*': ['./src/view/icons/*'], }, }, ], };};
But after all I still have an error. So what I can do to solve it?