JavaScript React - Google Map component not change map after re-render react google component,react component google maps,react google calendar

I have a problem with Google Map in React. Everything works great but, when I try to re-render other place in this map it doesnt work :( I mean when I change city (e.g. select) new props (latitude, longitude) are used , but city one the map not change

import React from 'react';
import ReactDOM from 'react-dom';
import { withGoogleMap, GoogleMap, Marker } from "react-google-maps";

const SimpleMapExampleGoogleMap = withGoogleMap( props => {
    console.log("here new props are used", props)
    return <GoogleMap
      defaultZoom={15}
      defaultCenter={new google.maps.LatLng(props.lat, props.lng)}
    />
 }
);

class GMap extends React.Component{
    constructor(props) {
        super(props);
        this.state = {
            lat: this.props.lat,
            lng: this.props.lng
        }
    }

    render() {
        console.log("New props ", this.props)

        return <SimpleMapExampleGoogleMap
                lat={this.props.lat}
                lng={this.props.lng}
                containerElement={
                  <div style={{ height: `500px` }} />
                }
                mapElement={
                  <div style={{ height: `500px` }} />
                }
            />
    }
}
export { GMap }
Answer:1

I have a nested object as a state and I have a form in a component. I was thinking of updating the state every time the user enter something in the form and to avoid creating many functions for each ...

I have a nested object as a state and I have a form in a component. I was thinking of updating the state every time the user enter something in the form and to avoid creating many functions for each ...

  1. setstate nested objects react
  2. how to setstate nested object

I've been trying to get tags working with Jquery Datatables for about 1 week now with no luck! I've gone through stackoverflow and have not found the help i'm looking for. This post here was ...

I've been trying to get tags working with Jquery Datatables for about 1 week now with no luck! I've gone through stackoverflow and have not found the help i'm looking for. This post here was ...

  1. datatables search tags

I am using Javascript ES6 classes. I have created a Player class as below: class Player { constructor() { ..... ..... } changeShipDirection(shipName, direction) { let redraw = ...

I am using Javascript ES6 classes. I have created a Player class as below: class Player { constructor() { ..... ..... } changeShipDirection(shipName, direction) { let redraw = ...

  1. javascript calling method
  2. javascript calling method from constructor
  3. javascript calling method within object
  4. javascript calling method name
  5. javascript call method by string
  6. javascript call method from another file
  7. javascript call method dynamically
  8. javascript call method inside class
  9. javascript call method every 5 seconds
  10. javascript call method after delay
  11. javascript call method from another class
  12. javascript call method without parentheses
  13. javascript call method by string name
  14. javascript call method in class
  15. javascript call method in same class
  16. javascript call method of parent class
  17. javascript call method asynchronously
  18. javascript call method if not null
  19. javascript call method by variable
  20. javascript call method on object

I have a simple application in angular 2. I want to display data in a paginated table. I found this example very nice and I would like to use in my app. Thehtml of the example is in home.component....

I have a simple application in angular 2. I want to display data in a paginated table. I found this example very nice and I would like to use in my app. Thehtml of the example is in home.component....

  1. include data table in angular