I see there are several issues raised (and closed) with this problem , but I also see that the solutions are somewhat confusing and obfuscated, at least to me. This is such an issue now that I cant fix, Im on the cusp of using an alternative solution to MobX , I really don't wish to, but I have found no explanation of what this error actually means, why it happens, and how to fix it. Most of the replies here are as confusing as the issue itself. (This is due to me). I would really like to solve this and get on with things!
Without giving up too much detail as the work is for a private client, I have the following situation:
I have a store "LocationStore" and a "RootStore" injected into my HomeScreen, and I have a react-native-maps MapView using observables from these stores.
// From LocationStore:
@observable current = {};
@action updateCurrent(newCurrent){
this.current = newCurrent;
}
From RootStore:
@observable isVisible = false;
At the time if its uses, current is correctly populated and then:
Error: [mobx] Dynamic observable objects cannot be frozen
This error is located at:
in AIRMap (at MapView.js:981)
in MapView (at HomeScreen.js:38)
in RCTView (at View.js:45)
in View (at HomeScreen.js:65)
in HomeScreen (created by inject-with-RootStore-LocationStore-FavouriteStore(HomeScreen))
in inject-with-RootStore-LocationStore-FavouriteStore(HomeScreen) (at SceneView.js:9)
in SceneView (at StackViewLayout.tsx:910)
in RCTView (at View.js:45)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewCard.tsx:106)
in RCTView (at View.js:45)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at screens.native.js:71)
in Screen (at StackViewCard.tsx:93)
in Card (at createPointerEventsContainer.tsx:95)
in Container (at StackViewLayout.tsx:985)
in RCTView (at View.js:45)
in View (at screens.native.js:101)
in ScreenContainer (at StackViewLayout.tsx:394)
in RCTView (at View.js:45)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewLayout.tsx:384)
in PanGestureHandler (at StackViewLayout.tsx:377)
in StackViewLayout (at withOrientation.js:30)
in withOrientation (at StackView.tsx:104)
in RCTView (at View.js:45)
in View (at Transitioner.tsx:267)
in Transitioner (at StackView.tsx:41)
in StackView (at createNavigator.js:80)
in Navigator (at createKeyboardAwareNavigator.js:12)
in KeyboardAwareNavigator (at SceneView.js:9)
in SceneView (at SwitchView.js:12)
in SwitchView (at createNavigator.js:80)
in Navigator (at createAppContainer.js:430)
in NavigationContainer (at App.js:59)
in RCTView (at View.js:45)
in View (at App.js:57)
in MobXProvider (at App.js:56)
in App (at withExpoRoot.js:20)
in RootErrorBoundary (at withExpoRoot.js:19)
in ExpoRootComponent (at renderApplication.js:35)
in RCTView (at View.js:45)
in View (at AppContainer.js:98)
in RCTView (at View.js:45)
in View (at AppContainer.js:115)
in AppContainer (at renderApplication.js:34)
It seems to be because of the MapView component, but I cannot see what's happening here. Is it my code or a bug, or the MapView component? Some clarity and help here would truly be appreciated, Im at the end of my wits on this one!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.
I see there are several issues raised (and closed) with this problem , but I also see that the solutions are somewhat confusing and obfuscated, at least to me. This is such an issue now that I cant fix, Im on the cusp of using an alternative solution to MobX , I really don't wish to, but I have found no explanation of what this error actually means, why it happens, and how to fix it. Most of the replies here are as confusing as the issue itself. (This is due to me). I would really like to solve this and get on with things!
Without giving up too much detail as the work is for a private client, I have the following situation:
I have a store "LocationStore" and a "RootStore" injected into my HomeScreen, and I have a react-native-maps MapView using observables from these stores.
At the time if its uses, current is correctly populated and then:
It seems to be because of the MapView component, but I cannot see what's happening here. Is it my code or a bug, or the MapView component? Some clarity and help here would truly be appreciated, Im at the end of my wits on this one!