|
@@ -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
|
|