应用程序在React Native中重新启动后,购物车中的商品未显示在购物车中

问题描述

购物车应用重新启动后,购物车中没有显示商品。我认为这归因于空数组cartItems。

         import {AsyncStorage} from 'react-native'
        const cartItems = [] // 
         AsyncStorage.getItem("cartItems").then(res=>
           res!=null?res:[])
           
         const initState = { cart: { items: cartItems } };
        const composeEnhancer = window.__Redux_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
       const store = createStore(
           rootReducers,initState,composeEnhancer(applyMiddleware(thunk))
         );
         export default store;

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)