Error storing data TypeError: Cannot read property 'setItem' of undefined
Closed this issue · 1 comments
pentarex commented
Hi,
I am receiving this exception at some point.
Error storing data TypeError: Cannot read property 'setItem' of undefined.
store.js
**
* Storage config for authReducer
*/
const sensitiveStorage = createSensitiveStorage({
keychainService: 'myKeychain',
sharedPreferencesName: 'mySharedPrefs'
});
const tokenPersistConfig = {
key: 'token',
storage: sensitiveStorage,
whitelist: ['authReducer']
};
export default (initialState) => {
let reducer = persistReducer(tokenPersistConfig, reducers);
let enhancer;
if (__DEV__) {
enhancer = compose(applyMiddleware(thunk, logger));
} else {
enhancer = compose(applyMiddleware(thunk));
}
const store = createStore(reducer, initialState, enhancer);
return store;
};
package.json
"react": "16.0.0",
"react-native": "0.51.0",
"redux-persist": "^5.9.1",
"redux-persist-sensitive-storage": "^1.0.0",
"react-native-sensitive-info": "^5.1.0"
pentarex commented
sorry my issue, for some reason the library (react-native-sensitive-info) wasn't linked correctly and in MainApplication the import for the class wasn't there