sharepoint online – SPFx React web part on AfterPropertyPaneChangesApplied


I created a simple web part in React and SPFX for Sharepoint Online. In this web part

weather.tsx has all representations and functions of the web part. in the componentDidMount Function I call the external API function by passing parameters and setState This will render the web part with new values.

public componentDidMount() {
    this.getWeather(this.props.latitude, this.props.longitude, 'si').then((weatherForcast: IWeather) => {
      this.setState({
        weatherForcast: weatherForcast
      })
    })

    this.getLocation(this.props.latitude, this.props.longitude).then((location: ILocation) => {
      this.setState({
        Locations: location
      })
    })

  }

WeatherWebPart.ts has all the labels and fields of the property window that are checked. I don't make this property area reactive and added onAfterPropertyPaneChangesApplied But I don't know how to call this function in this web part and change the status