Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
const { options } = this.props
const { position, ...infoBoxOptions }: InfoBoxOptions = options || {}
let positionLatLng: google.maps.LatLng | undefined
if (position && !(position instanceof google.maps.LatLng)) {
positionLatLng = new google.maps.LatLng(position.lat, position.lng)
}
const infoBox = new GoogleMapsInfoBox({
...infoBoxOptions,
...(positionLatLng ? { position: positionLatLng } : {}),
})
this.containerElement = document.createElement('div')
this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({
updaterMap,
eventMap,
prevProps: {},
nextProps: this.props,
instance: infoBox,
})
this.setState({ infoBox }, this.setInfoBoxCallback)
}