score:0

const [state] = this.context;
    const { testData } = state;

    const fetchData = async () => {
      console.log("fetching data");
      this.setState({ loading: true });
      this.updateTestData();
    };

componentDidMount() {
    if (testData === "" || testData[0]?.ur !== this.props.ur) {
       fetchData();
    }
  }

Related Query

More Query from same tag