在我的应用程序中安装 ant mobile 后,我尝试在我的应用程序中使用卡片组件,但是当我在 web 上或在我的手机上通过 expo 启动应用程序时,我总是收到相同的错误(错误的完整日志是:Module not成立:
Can't resolve './src/refreshableScrollView' in 'C:\Users\User\Desktop\AwesomeProject\node_modules\@bang88\react-native-ultimate-listview
idk(如果需要,但我已经发布的所有信息)',有人知道如何解决吗?
我最近遇到了同样的问题,并且已经解决了这个问题。
首先你需要使用 expo 而不是 npm 来安装 ant mobile: expo install @ant-design/react-native
同时安装 babel-plugin-import: expo install babel-plugin-import
然后babel.config.js
像这样修改文件:
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
['import', {libraryName: '@ant-design/react-native'}],
],
};
};
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句