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
5
5
import MapContext from '../../map-context'
6
6
7
7
import { Clusterer } from '@react-google-maps/marker-clusterer'
8
+ import { ReactNode } from 'react'
8
9
9
10
const eventMap = {
10
11
onAnimationChanged : 'animation_changed' ,
@@ -248,11 +249,13 @@ export class Marker extends React.PureComponent<MarkerProps, MarkerState> {
248
249
}
249
250
250
251
render ( ) : React . ReactNode {
251
- let children : JSX . Element | null = null
252
+ let children : ReactNode [ ] | null = null
252
253
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
+ )
254
257
}
255
- return this . props . children || null
258
+ return children || null
256
259
}
257
260
}
258
261
You can’t perform that action at this time.
0 commit comments