andrea.nieves7 пре 2 година
родитељ
комит
523a1c7ede
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1
    2
      App.js

+ 1
- 2
App.js Прегледај датотеку

12
   xhttp.onreadystatechange = function() {
12
   xhttp.onreadystatechange = function() {
13
     if (this.readyState == 4 && this.status == 200) {
13
     if (this.readyState == 4 && this.status == 200) {
14
          information = this.responseText;
14
          information = this.responseText;
15
-		 App.setData()
16
   }
15
   }
17
   };
16
   };
18
   xhttp.open("GET", "https://api.census.gov/data/2020/acs/acs5/profile?get=group(DP02PR)&for=county:127&in=state:72", true);
17
   xhttp.open("GET", "https://api.census.gov/data/2020/acs/acs5/profile?get=group(DP02PR)&for=county:127&in=state:72", true);
137
 
136
 
138
 //state changing functions
137
 //state changing functions
139
 setHome = () => this.setState({ current: states.welcome })
138
 setHome = () => this.setState({ current: states.welcome })
140
-setData = () => this.setState({ current: states.dataView })
139
+setData = () => {loadDoc(); this.setState({ current: states.dataView })}
141
 setNews = () => this.setState({ current: states.newsView })
140
 setNews = () => this.setState({ current: states.newsView })
142
 	
141
 	
143
 	
142