遅延情報がある時だけ欄が出現するように変更
This commit is contained in:
parent
47bba10c04
commit
fc091a2ae6
20
App.js
20
App.js
@ -91,19 +91,19 @@ export default function App() {
|
|||||||
|
|
||||||
useInterval(getCurrentTrain, 15000); //15秒毎に全在線列車取得
|
useInterval(getCurrentTrain, 15000); //15秒毎に全在線列車取得
|
||||||
|
|
||||||
// const [areaInfo, setAreaInfo] = useState();
|
const [areaInfo, setAreaInfo] = useState("");
|
||||||
// const getAreaInfo = () => {
|
const getAreaInfo = () => {
|
||||||
// fetch(
|
fetch(
|
||||||
// "https://script.google.com/macros/s/AKfycbz80LcaEUrhnlEsLkJy0LG2IRO3DBVQhfNmN1d_0f_HvtsujNQpxM90SrV9yKWH_JG1Ww/exec"
|
"https://script.google.com/macros/s/AKfycbz80LcaEUrhnlEsLkJy0LG2IRO3DBVQhfNmN1d_0f_HvtsujNQpxM90SrV9yKWH_JG1Ww/exec"
|
||||||
// )
|
)
|
||||||
// .then((d) => d.text())
|
.then((d) => d.text())
|
||||||
// .then((d) => setAreaInfo(d));
|
.then((d) => setAreaInfo(d));
|
||||||
// };
|
};
|
||||||
// useEffect(getAreaInfo, []);
|
useEffect(getAreaInfo, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
||||||
{/* {areaInfo != "" && <Text onPress={() => alert(areaInfo)}>{areaInfo}</Text>} */}
|
{areaInfo != "" && <Text onPress={() => alert(areaInfo)}>{areaInfo}</Text>}
|
||||||
<Tab.Navigator detachInactiveScreens={false}>
|
<Tab.Navigator detachInactiveScreens={false}>
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
name="login"
|
name="login"
|
||||||
|
Loading…
Reference in New Issue
Block a user