Skip to content

Commit 00b9428

Browse files
authored
Merge pull request #277 from jackpilowsky/patch-1
Adding support for InfoWindow as a prop child of Marker
2 parents d87b73b + d5574a4 commit 00b9428

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/components/Marker.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React, {Fragment} from 'react'
22
import PropTypes from 'prop-types'
33

44
import { camelize } from '../lib/String'
@@ -104,7 +104,20 @@ export class Marker extends React.Component {
104104
}
105105

106106
render() {
107-
return null;
107+
return (
108+
<Fragment>
109+
{this.props.children && this.marker ?
110+
React.Children.only(
111+
React.cloneElement(
112+
this.props.children,
113+
{ marker: this.marker,
114+
google: this.props.google,
115+
map: this.props.map}
116+
)
117+
) : null
118+
}
119+
</Fragment>
120+
)
108121
}
109122
}
110123

0 commit comments

Comments
 (0)