Skip to content

Commit

Permalink
fix(VirtualContainer): preserve ref for React.cloneElement
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed May 1, 2015
1 parent 875e4ee commit 3d3be96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class SimpleClickEvent extends React.Component {

_handle_map_center_changed () {
const {center, timeoutId} = this.state;
const {marker} = this.refs;
if (!marker) {
return;
}
const newPos = this.refs.marker.getPosition();
if (center.equals(newPos)) {
// Notice: Check newPos equality here,
Expand Down
1 change: 0 additions & 1 deletion src/internals/VirtualContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class VirtualContainer extends React.Component {
const extraProps = {
googleMapsApi: props.googleMapsApi,
map: props.map,
ref: null,
};

return React.Children.map(props.children, (child) => {
Expand Down

0 comments on commit 3d3be96

Please sign in to comment.