diff --git a/src/MapContainer.js b/src/MapContainer.js index af21b8a..90cb386 100644 --- a/src/MapContainer.js +++ b/src/MapContainer.js @@ -17,6 +17,10 @@ export default class MapContainer extends Component { ] } + componentDidMount() { + this.loadMap(); // call loadMap function to load the google map upon mounting the component + } + componentDidUpdate() { this.loadMap(); // call loadMap function to load the google map } @@ -63,4 +67,4 @@ export default class MapContainer extends Component { ) } -} \ No newline at end of file +}