src/Map/MainMap.js
// code to run when the component receives prop or state updates.
code to run when the component receives prop or state updates.
code to run when the component receives prop or state updates .
componentDidUpdate(prevProps, prevState) {
    if (this.state.geojson !== prevState.geojson){
      this.addGeoJSONLayer(this.state.geojson, this.state.geojson_key);
    }
  }
componentDidUpdate ( prevProps , prevState ) { if ( this . state . geojson !== prevState . geojson ) { this . addGeoJSONLayer ( this . state . geojson , this . state . geojson_key ) ; } }
code to run when the component receives prop or state updates.
code to run when the component receives prop or state updates .
// Render map again if new geojson data is added.