andrea.nieves7 1 year ago
parent
commit
523a1c7ede
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      App.js

+ 1
- 2
App.js View File

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