Skip to content

Additional div rendered? #227

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

Open
hashharvest opened this issue Jun 21, 2018 · 2 comments
Open

Additional div rendered? #227

hashharvest opened this issue Jun 21, 2018 · 2 comments

Comments

@hashharvest
Copy link

hashharvest commented Jun 21, 2018

I noticed that the component renders an additional DIV in the GoogleApiComponent file during the render (see line 119 in file).

Why not add ability for className on this DIV or use a different sort of wrapper using something like:

const wrapper = (props) => props.children;

So the additional div is not rendered? Or is there a reason a div was used?

@bertuz
Copy link

bertuz commented Oct 3, 2020

Guys, it took too much time to be fixed this and I've forked and created my own version to fixed. I've also opened a pull request on this repo, let's see if they'll merge it, eventually.

The pull request:
#483

My branch with the fix:
https://github.com/bertuz/google-maps-react/tree/stylized-div-wrapper

My branch with built files, in order to use it with npm (or yarn or whatever):
https://github.com/bertuz/google-maps-react/tree/wrapping-div-with-styles

To use it directly you can add it like this:

yarn add "https://github.com/bertuz/google-maps-react.git#v2.0.7-alpha.1"

@LucasBrandt
Copy link

After running into this problem myself, and seeing that it's unlikely to be resolved here, I "solved" it by using @googlemaps/react-wrapper instead. One caveat is that I couldn't just replace it in one place or component, I had to make the same change everywhere in my application to avoid loading the Google Maps API twice. That library didn't exist when this issue was first reported, so it's a new option for anyone running into the problem today.

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

No branches or pull requests

3 participants