React-google-maps: While trying to use InfoWindow getting error 'React.Children.only expected to receive a single React element child'

Created on 4 Apr 2018  路  3Comments  路  Source: tomchentw/react-google-maps

Hello, I am trying to use the InfoWindow with Marker as mentioned in the documentation but still getting the error. using 9.0.2 version currently?

Can you please tell me what is the problem here? And how do I solve it?

<Marker position={props.latlng} icon={{url:marker,anchor:{x:20,y:20}}} animation={true} onClick={()=>props._onChange}>
      <InfoWindow> hello world </InfoWindow>
</Marker>

screen shot 2018-04-05 at 1 44 02 am

Most helpful comment

right:

<InfoWindow>
  <div>blabla</div>
</InfoWindow>

error:

<InfoWindow>
  blabla
</InfoWindow>

All 3 comments

Anything ?? @tomchentw

I've done showing InfoWindow outside the marker component and it worked. thanks

right:

<InfoWindow>
  <div>blabla</div>
</InfoWindow>

error:

<InfoWindow>
  blabla
</InfoWindow>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnantoni picture johnantoni  路  3Comments

LukasZvikas picture LukasZvikas  路  3Comments

timkraut picture timkraut  路  3Comments

julienvincent picture julienvincent  路  3Comments

manoj150283 picture manoj150283  路  3Comments