title: setState() does not assigns value to an array
body: <p>I have a state as follows inside the constructor</p>
  <pre><code>this.state = {
  type: {
              Building: false,
              House : false,
              Plot : false,
              FarmHouse : false,
          },
          location : {
              Lahore : false,
              Islamabad : false,
              Karachi : false,
              Peshawar : false
          },
          clicked : false,
          propertyFound: []
      }
      
  </code></pre>
  <p>I have imported {PropertyData} from another file that has data in the following format</p>
  <pre><code>export const PropertyData = [
      {   
          id:0,
          propertyType: 
                      &quot;Building&quot;,
          location : &quot;Lahore&quot;,
          society : &quot;wapdatown&quot;,
  
      },
      {   
          id:1,
          propertyType: 
                      &quot;House&quot;,
          location : &quot;Islamabad&quot;,
          society : &quot;faisaltown&quot;, 
      },
      {   
          id:2,
          propertyType: 
                      &quot;Plot&quot;,
          location : &quot;Karachi&quot;,
          society : &quot;johartown&quot;,
      },
      {   
          id:3,
          propertyType: 
                      &quot;Building&quot;,
          location : &quot;Islamabad&quot;,
          society : &quot;wapdatown&quot;,
      }
        
  ]
  </code></pre>
  <p>Now I wish to filter data from the {PropertyData} according to the user's input. locationValues contains the value of the city which the user has given. findCity() filters data and returns the data which contains location === city entered by the user.</p>
  <pre><code>findCity(){
          let newArray = [];
          for(let locationValues in this.state.location){
              if(this.state.location[locationValues] === true ){
                  newArray = PropertyData.filter(element =&gt; 
                      element.location === locationValues   
                  )
              }
              this.setState({propertyFound : newArray},() =&gt; console.log(this.state.propertyFound));
          }       
      }
  </code></pre>
  <p>I console.log(newArray) and it gives me correct values but this.state.propertyFound is empty. Alternatively, I tried another logic.</p>
  <pre><code>for(let typeValues in this.state.type){
          for(let locationValues in this.state.location){
              if(this.state.type[typeValues] === true  &amp;&amp; this.state.location[locationValues] === true){
                  PropertyData.forEach((item,index,arr) =&gt; {
                      if(arr[index].propertyType === typeValues &amp;&amp; arr[index].location === locationValues){
                          // this.setState({
                          // propertyFound : [...this.state.propertyFound,item]
                          //})
                          let newArray;
                          newArray = this.state.propertyFound.push(item);
                          this.setState({propertyFound : newArray});
                      }
                      
                  })
  
              }
          } 
      }
    
  </code></pre>
  <p>This works perfectly fine and gives correct results. Can anyone explain the issue in above logic that I am trying to implement?</p>