easy-peasy
easy-peasy copied to clipboard
Cannot read property 'persist' of undefined
React Native cause error when using "useStoreRehydrated"
import React, {memo} from 'react';
import {Text, View} from 'react-native';
import {useStoreRehydrated} from 'easy-peasy';
function App() {
const rehydrated= useStoreRehydrated();
if (!rehydrated) {
return null;
}
return (
<View style={{flex: 1, backgroundColor: 'white'}}>
<Text>hello</Text>
</View>
);
}
export default App;
Stack Trace in RNDebugger
D:\Code\Sarthi\com.sarthiacademy.org\node_modules\react-native\Libraries\Core\ExceptionsManager.js:179 TypeError: Cannot read property 'persist' of undefined
This error is located at:
in App (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)
D:\Code\Sarthi\com.sarthiacademy.org\node_modules\react-native\Libraries\Core\ExceptionsManager.js:179 TypeError: Cannot read property 'persist' of undefined
This error is located at:
in App (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)
Hmm, is the StoreProvider for sure wrapping the application?
Hmm, is the
StoreProviderfor sure wrapping the application?
Yes, I did it very well
@krunaldodiya was this running via the Expo CL, and RN Web?
@krunaldodiya was this running via the Expo CL, and RN Web?
no, there is the same issue
any update on this?
Any update on this ? Still have the same issue
Anyone manage to solve this? RN 0.70, easy-peasy 5.0.4
I do not have any RN experience, so I'm unable suggest any resolutions for this. @ctrlplusb got any input here?
Maybe this is related to #599? And maybe this is a workaround?
This was fixed in #836