Search code examples
react-nativeantd-mobile

Module not found: Can't resolve './src/refreshableScrollView


after installing ant mobile in my app i've tryed to use a card component in my app but when i launch the application in web or on my phone with expo I always receive the same error(the full log of the error is: Module not found:

Can't resolve './src/refreshableScrollView' in 'C:\Users\User\Desktop\AwesomeProject\node_modules\@bang88\react-native-ultimate-listview

idk if is needed but every info I have I've posted)', anyone know how to fix it?


Solution

  • I recently have the same problem and have figured this out.

    First you need to install ant mobile using expo instead of npm: expo install @ant-design/react-native

    Also install babel-plugin-import: expo install babel-plugin-import

    Then modify the babel.config.js file like this:

    module.exports = function(api) {
      api.cache(true);
      return {
        presets: ['babel-preset-expo'],
        plugins: [
          ['import', {libraryName: '@ant-design/react-native'}],
        ],
      };
    };