title: How to call two APIs' using redux and getDerivedStateFromProps and componentdidupdate
body: <p>Trying to call two API's through react-redux. Have written reducer and actions.Please find the code.</p>
  
  <pre><code>`````````
       home.js
      componentDidMount() {
      const URL = GET_ALL_ENTITIES;
      const ETURL = GET_ALL_TENANT_ENTITIES;
  
       this.props.GetAllEntitesAction(URL,header,"DISPLAY_ALL");
        // how to catch below api response
       this.props.GetTenantEntitesAction(ETURL,header,"DISPLAY_ALL_TENANTS")
  
      }
  
      static getDerivedStateFromProps(nextProps, prevProps) {
      if (nextProps.responseData != prevProps.responseData) {
        return {
          responseData: nextProps.responseData,
        };
      }
         return null;
     }
  
     componentDidUpdate(prevProps) {
        if (this.props.responseData != this.state.response) {
          this.setState({ 
          response: this.props.responseData,
          });
        }
     }
  
    render() {
      let {response}=this.state;
      console.log("allentitiesData",response.allentitiesData)
      console.log("alltenants",response.alltenants) //Getting undefined
     }
  
  
      reducer.js
       let newState = {};
        const HomeReducer = (state=[],action)=&gt;{
  
         switch (action.type) {
           case 'DISPLAY_ALL':
            newState.allentitiesData = action.payload;
            break;
  
            case 'DISPLAY_ALL_TENANTS':
            newState.alltenants = action.payload;
            break;
  
         default: return state;
       }
  
       return newState;
   };
  
    export default HomeReducer;
  </code></pre>
  
  <p>If I call both the API's, one of them gets overridden or undefined. How to 
    I catch and display both he responses. I have tried with set state as<br>
     response: this.props.responseData.allentitiesData, but it gives 'maximum 
     update depth exceeded componentdidupdate' error. How can we do this?</p>