File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/react-google-maps-api/src/components/drawing Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { unregisterEvents, applyUpdatersToPropsAndRegisterEvents } from '../../u
55import MapContext from '../../map-context'
66
77import { Clusterer } from '@react-google-maps/marker-clusterer'
8+ import { ReactNode } from 'react'
89
910const eventMap = {
1011 onAnimationChanged : 'animation_changed' ,
@@ -248,11 +249,13 @@ export class Marker extends React.PureComponent<MarkerProps, MarkerState> {
248249 }
249250
250251 render ( ) : React . ReactNode {
251- let children : JSX . Element | null = null
252+ let children : ReactNode [ ] | null = null
252253 if ( this . props . children ) {
253- children = this . props . children . map ( ( e ) => { return React . cloneElement ( e , { anchor : this . state . marker } ) } )
254+ children = React . Children . toArray ( this . props . children ) . map (
255+ ( e ) => { return React . cloneElement ( e , { anchor : this . state . marker } ) }
256+ )
254257 }
255- return this . props . children || null
258+ return children || null
256259 }
257260}
258261
You can’t perform that action at this time.
0 commit comments