Skip to content

Commit

Permalink
fix(addons/InfoBox): named require from google-maps-infobox module
Browse files Browse the repository at this point in the history
* Closes #711
  • Loading branch information
tomchentw committed Nov 26, 2017
1 parent d8ebf4a commit 6fc7841
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/addons/InfoBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export class InfoBox extends React.PureComponent {
if (!canUseDOM || this.state[INFO_BOX]) {
return
}
const GoogleMapsInfobox = require(/* "google-maps-infobox" uses "google" as a global variable. Since we don't
const {
InfoBox: GoogleMapsInfobox,
} = require(/* "google-maps-infobox" uses "google" as a global variable. Since we don't
* have "google" on the server, we can not use it in server-side rendering.
* As a result, we import "google-maps-infobox" here to prevent an error on
* a isomorphic server.
Expand Down Expand Up @@ -160,23 +162,23 @@ export class InfoBox extends React.PureComponent {
}

/**
*
*
* @type LatLng
*/
getPosition() {
return this.state[INFO_BOX].getPosition()
}

/**
*
*
* @type boolean
*/
getVisible() {
return this.state[INFO_BOX].getVisible()
}

/**
*
*
* @type number
*/
getZIndex() {
Expand Down

0 comments on commit 6fc7841

Please sign in to comment.