Skip to content

Bug: Boolean Props set to false are not passed to the mapConfig #50

@ianoff

Description

@ianoff

If you set a boolean prop to false, it gets deleted on Line 155/156:

if (!mapConfig[key]) { 
    delete mapConfig[key]; 
} 

https://github.com/fullstackreact/google-maps-react/blob/master/src/index.js#L155

This would be fine if the defaults for these options were always false, but a lot of the UI options (such as draggable) default to true. So there’s pretty much no way to set them to false and actually have the option get passed to the map upon instantiation.

I can submit a PR for this— it’s a pretty simple fix (mapConfig[key] == null). Just wanted to flag it as a bug first.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions