Skip to content

Commit d2ea8e6

Browse files
authored
Add key properties for google map
1 parent 15a0c87 commit d2ea8e6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Fable.ReactGoogleMaps/mapComponent.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,26 @@ const TrafficMapComponent = withScriptjs(withGoogleMap((props) => {
2626
var searchBox =
2727
React.createElement(SearchBox,
2828
{ ref : props.onSearchBoxMounted,
29-
bounds : props.bounds,
30-
controlPosition : google.maps.ControlPosition.TOP_LEFT,
31-
onPlacesChanged : props.onPlacesChanged },
32-
inputBox
29+
key: "googlemaps-searchBox",
30+
bounds : props.bounds,
31+
controlPosition : google.maps.ControlPosition.TOP_LEFT,
32+
onPlacesChanged : props.onPlacesChanged },
33+
inputBox
3334
);
3435

3536
childs = [ searchBox, ...childs ];
3637
};
3738

3839
if(props.showTrafficLayer) {
39-
var traffic = React.createElement(TrafficLayer, { });
40+
var traffic = React.createElement(TrafficLayer, { key: "googlemaps-traffic-layer" });
4041
childs = [ traffic, ...childs ]
4142
};
4243

4344
return (
4445
React.createElement(
4546
GoogleMap,
4647
{ defaultZoom : props.defaultZoom,
48+
key: "googlemaps-map",
4749
onZoomChanged : props.onZoomChanged,
4850
onIdle : props.onIdle,
4951
defaultCenter : props.defaultCenter,
@@ -108,4 +110,4 @@ export class GoogleMapComponent extends React.PureComponent {
108110
mapElement: mapElement
109111
}))
110112
}
111-
}
113+
}

0 commit comments

Comments
 (0)