DEV Community

Cover image for Typescript path alias in React Native + Expo without `babel-plugin-module-resolver`
Ruan Azevedo
Ruan Azevedo

Posted on

Typescript path alias in React Native + Expo without `babel-plugin-module-resolver`

In Expo 49+ you no longer need a module-resolver.
Bye-bye babel-plugin-module-resolver! 👋

ps.: if your project is using Expo 50 the config tsConfigPaths is enabled by default, so you don't need to update your app.json.

Now you can add the path aliases to your tsconfig.json. Checkout the baseUrl and paths nodes below:

And now, import your component in your app:

import AwesomeComponent from '@components/AwesomeComponent';
Enter fullscreen mode Exit fullscreen mode

That's it! 🎉

Top comments (0)