I\'m using react-native-maps
but I faced a problem that after a lot of googling without answer makes me ask it here.
I\'m trying to use Custom Marker for the marker
My problem was solved right now.
I hope your problem will be solved.
import React, {Component} from 'react';
import {ImageBackground, Text} from 'react-native';
import {Marker} from 'react-native-maps';
export default class CustomMarker extends Component {
state = {
initialRender: true
}
render() {
return (
// *** These lines are very important ***
onLoad={() => this.forceUpdate()}
onLayout={() => this.setState({initialRender: false})}
key={`${this.state.initialRender}`}
>
// **** This line is very very important ****
{Math.random()}
);
}
}