-
-
Notifications
You must be signed in to change notification settings - Fork 881
Fixed Issue : #3756 ( Mapbox [error] ViewTagResolver) #3852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…null found with tag ) It's a fix for this issue : rnmapbox#3756
@@ -1171,6 +1171,14 @@ class MapView extends NativeBridgeComponent( | |||
} | |||
} | |||
|
|||
if (mapView == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this is good way to solve the issue.
mapView
will be null if on layout has not been called yet.
Can't we just add an else
to set mapView to an empty fragment instead of null?
if (this.state.isReady) {
...
} else {
mapView = <></>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Med-Li-Jr code works. @mfazekas your suggestion does not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfazekas, yeah me too, I didn't think it was a good way to solve it, but it was the only one amongs the things I tried that solved it on my side, I tried the following, but other errors appeared :
-
Attemp 1 :
let mapView = {} as NativeMapViewActual; if (this.state.isReady) { ... }
-
Attemp 2 :
let mapView = <RNMBXMapView> </RNMBXMapView>; if (this.state.isReady) { ... }
-
Attemp 3 :
let mapView = <></>; if (this.state.isReady) { ... }
-
etc....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LukasB-DEV, I see, then just changed it on your local code, maybe later, there will be an update that will fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Med-Li-Jr is there a code to reproduce the issue? It's not clear in #3756 how to reproduce the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfazekas it's a new project with the version 10.1.37, I just tried to create a new complete project with the latest version of expo and rnmapbox, but it didn't work too.
Step to reproduce the issue :
- npx create-expo-app --template default@53.0.7
- npm i @rnmapbox/maps@10.1.37
- npm run reset-project
in the app/index.tsx file :
import Mapbox from '@rnmapbox/maps';
import React from 'react';
import { StyleSheet, View } from 'react-native';
Mapbox.setAccessToken('xxxxxxxxxxxxxxxx');
const App = () => {
return (
<View style={styles.page}>
<View style={styles.container}>
<Mapbox.MapView style={styles.map} />
</View>
</View>
);
}
export default App;
const styles = StyleSheet.create({
page: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
container: {
height: 300,
width: 300,
},
map: {
flex: 1
}
});
- npx expo prebuild --clean
- npm run android
Description
Fixes #3756
File Changed : MapView.tsx
Added
your feature
that allows ...Checklist
CONTRIBUTING.md
yarn generate
in the root folder/example
app./example
)Screenshot OR Video
Component to reproduce the issue you're fixing