2017-07-02 160 views
0

我試圖修改我的react-native應用程序的狀態;但是,修改後,我收到以下錯誤消息。 Error Message無法讀取React-Native/VirtualizedSectionList.js中未定義的屬性長度

我有堆棧將其跟蹤到本機的VirtualizedSectionList中的第230行。我不確定究竟會導致錯誤。一個潛在的解決方案可能會重置我的反應本地存儲,但我無法弄清楚如何做到這一點。這是我目前的redux商店代碼。

'use strict'; 
 

 

 
import {applyMiddleware, createStore} from 'redux'; 
 
import thunk from 'redux-thunk'; 
 
import {persistStore, autoRehydrate} from 'redux-persist'; 
 
import {AsyncStorage} from 'react-native'; 
 
import reducers from '../reducers'; 
 

 
const logger = store => next => action => { 
 
\t if(typeof action === 'function') console.log('dispatching a function'); 
 
\t else console.log('dispatching', action); 
 
\t let result = next(action); 
 
\t console.log('next state', store.getState()); 
 
\t return result; 
 
} 
 

 
let middlewares = [ 
 
\t logger, 
 
\t thunk 
 
]; 
 

 
let createAppStore = applyMiddleware(...middlewares)(createStore); 
 

 

 
export default function configureStore(onComplete:()=>void){ 
 
\t const store = autoRehydrate()(createAppStore)(reducers); 
 
\t let opt = { 
 
\t \t storage: AsyncStorage, 
 
\t \t transform: [], 
 
\t \t blacklist: ['nav','util'] 
 
\t }; 
 
\t persistStore(store, opt, onComplete); 
 
\t return store; 
 
}

感謝

回答

0

這似乎並不與儲存的問題,我認爲這是有你在哪裏使用烏爾狀態可能會或別的東西,如果你上傳的其他代碼比我可以檢查它,但我不認爲這個錯誤是由於存儲。

+0

是的,它最終是如何創建行的錯誤。感謝您的幫助。 – jaysig

相關問題