andrea.nieves7 1 год назад
Родитель
Сommit
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