Coder Social home page Coder Social logo

Comments (13)

tomchentw avatar tomchentw commented on May 13, 2024

Kind of interesting. What's your expected API ?

from react-google-maps.

tomchentw avatar tomchentw commented on May 13, 2024

Since #32 is landed, currently the InfoWindow API would look like this:
<InfoWindow title="Blabla" onClick={this.handleClick} />

Combined with marker:

<Marker lat={lat} lng={lng}>
  <InfoWindow title="Blabla" onClick={this.handleClick}>
</Marker>

Proposed API for InfoWindow with React component:

<InfoWindow title="Blabla" onClick={this.handleClick}>
  <MyFancyReactComponent>
    <ItShouldAlsoSupportDiffAlgorithmHere />
  </MyFancyReactComponent>
</InfoWindow>

Is this what you want?

from react-google-maps.

wuct avatar wuct commented on May 13, 2024

👍 This API is exactly what I want. But a content of InfoWindow is not in a react shadow DOMs tree, how will you implement this?

from react-google-maps.

metalmatze avatar metalmatze commented on May 13, 2024

This would be exactly what I need. It's crucial for my application!

from react-google-maps.

tomchentw avatar tomchentw commented on May 13, 2024

This can be implement by the following:

  1. Create a detached DOM using document.createElement
  2. Render the passed in child using React.render(React.Children.only(props.children), detachedDOM)
  3. Pass the detachedDOM into InfoWindow({content: detachedDOM})

What do you guys think?

from react-google-maps.

wuct avatar wuct commented on May 13, 2024

After passing the detachDOM to a InfoWindow, a InfoWindow will call setOptions to set the content internally. So the content of InfoWindow will remount into GoogleMaps DOM tree every time when the InfoWindow is update and won't utilize React diff right?

from react-google-maps.

tomchentw avatar tomchentw commented on May 13, 2024

No. As long as the detachedDOM is the same instance, React will recognize it.

from react-google-maps.

metalmatze avatar metalmatze commented on May 13, 2024

I know it's impolite to ask if anyone has implemented this feature, but I want to do it anyway since I would need this feature. Is there any progress? I'm just building my first app with react and I'm not quite sure if I could implement this feature myself. Sorry.

from react-google-maps.

tomchentw avatar tomchentw commented on May 13, 2024

Released v2.0.0 and v2.0.1.

from react-google-maps.

ashishchoudhary12 avatar ashishchoudhary12 commented on May 13, 2024

how to hide infow window close buttom???

from react-google-maps.

ashishchoudhary12 avatar ashishchoudhary12 commented on May 13, 2024

how to hide infow window close buttom???

from react-google-maps.

sriniss13 avatar sriniss13 commented on May 13, 2024

how to customize info window i can't change default style

from react-google-maps.

umair-khanzada avatar umair-khanzada commented on May 13, 2024

what about the Marker, can we pass jsx element against marker's icon props ?

from react-google-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.