Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Marker): allow null and undefined as children #119

Closed
wants to merge 1 commit into from
Closed

fix(Marker): allow null and undefined as children #119

wants to merge 1 commit into from

Conversation

idolizesc
Copy link
Contributor

This is useful if you have code like the following:

<Marker {...props}>
  { showInfo &&
    <InfoWindow content="Some Info" />
  }
</Marker>

Right now, this will throw an Error about being unable to read props of undefined, so you have to use the following workaround (not ideal):

// workaround:
<Marker {...props}>
  { showInfo ?
    <InfoWindow content="Some Info" />
    : <noscript />
  }
</Marker>

With this change, the workaround is no longer needed and the first example works as expected 😄

This is useful is you have code like the following:

``js
<Marker {...props}>
  { showInfo &&
    <InfoWindow content="Some Info" />
  }
</Marker>
```

Right now, this will throw an `Error` about being unable to read `props` of `undefined`, so you have to use the following workaround (not ideal):

```js
// workaround:
<Marker {...props}>
  { showInfo ?
    <InfoWindow content="Some Info" />
    : <noscript />
  }
</Marker>
```
@tomchentw tomchentw closed this in 17daa0a Sep 30, 2015
@tomchentw
Copy link
Owner

Thanks. Released v2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants