diff --git a/App.js b/App.js index 2eb95e5..428678d 100644 --- a/App.js +++ b/App.js @@ -6,7 +6,7 @@ import { } from "@react-navigation/stack"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { AntDesign, Ionicons } from "@expo/vector-icons"; -import { Platform, UIManager } from "react-native"; +import { Platform, UIManager, Text } from "react-native"; import { UpdateAsync } from "./UpdateAsync.js"; import { getStationList2 } from "./lib/getStationList2"; import { AS } from "./storageControl"; @@ -91,8 +91,19 @@ export default function App() { useInterval(getCurrentTrain, 15000); //15秒毎に全在線列車取得 + const [areaInfo, setAreaInfo] = useState(); + const getAreaInfo = () => { + fetch( + "https://script.google.com/macros/s/AKfycbz80LcaEUrhnlEsLkJy0LG2IRO3DBVQhfNmN1d_0f_HvtsujNQpxM90SrV9yKWH_JG1Ww/exec" + ) + .then((d) => d.text()) + .then((d) => setAreaInfo(d)); + }; + useEffect(getAreaInfo, []); + return ( + alert(areaInfo)}>{areaInfo}