-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eyal Keren
committed
Dec 5, 2023
1 parent
0408e0f
commit e5afedb
Showing
2 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
import logo from './logo.svg'; | ||
import {useEffect, useState} from "react"; | ||
import './App.css'; | ||
|
||
function App() { | ||
const [title, setTitle] = useState("Default Value"); | ||
const getTitle = async () => { | ||
const response = await fetch(`${window.wingEnv.apiUrl}/title`); | ||
setTitle(await response.text()); | ||
} | ||
|
||
useEffect(() => { | ||
getTitle(); | ||
}, []); | ||
|
||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
{title} | ||
</header> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; | ||
export default App; |