-
-
Save StephenDRoberts/568349c7046b9804d493c4245939cbc8 to your computer and use it in GitHub Desktop.
App component which renders the data
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
import React from 'react'; | |
import './App.css'; | |
import { useGetDailyPrices } from './hooks/use-queries'; | |
function App() { | |
const data = useGetDailyPrices() | |
if (data.length === 0) return null; | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<h2>Stock Prices</h2> | |
<div className="row"> | |
<p>First</p> | |
<p>{data[0].last}</p> | |
</div> | |
<div className="row"> | |
<p>Last</p> | |
<p>{data[data.length - 1].last}</p> | |
</div> | |
</header> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment