首页 文章

无法解决react-native-swiper

提问于
浏览
0

对原生的反应比较新 . 发出以下命令以创建新的react本机项目:

create-react-native-app SwiperExample cd SwiperExample npm install --save react-native-swipe-gestures

我修改了App.js并包含在内

从'react-native-swiper'导入Swiper;

当我使用npm start进行测试时,我出现以下错误:

无法解决react-native-swiper“来自”./C:\Users\sue\ReactNativeApps\SwiperExample\App.js“构建JavaScript包失败

我的package.json包含以下dependecies

“dependencies”:{“expo”:“^ 25.0.0”,“react”:“16.2.0”,“react-native”:“0.52.0”,“react-native-swipe-gestures”:“ ^ 1.0.2“}

有什么建议有什么不对吗?

1 回答

  • 1

    你做错了导入改变这个

    import Swiper from 'react-native-swiper';
    

    通过

    import Swiper from 'react-native-swiper-gestures';
    

    或者安装正确的软件包,以防您安装错误的软件包

    npm install --save react-native-swipe
    

相关问题