use absolute imports in react native project without typescript

Viewed 205

How can i set absolute imports in react native project which is not using typescript. I watched many tutorials but they all talking about tsconfig.json, others are not working, that's what i tried in babel.config.js:


module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      [
        'module-resolver',
        {
          alias: {
            'src': './src',
          },
        },
      ],
    ],
  };
};

1 Answers

Hey there I guess this blog can help you.

Related