Skip to content

Instantly share code, notes, and snippets.

@StephenDRoberts
Created August 21, 2020 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephenDRoberts/568349c7046b9804d493c4245939cbc8 to your computer and use it in GitHub Desktop.
Save StephenDRoberts/568349c7046b9804d493c4245939cbc8 to your computer and use it in GitHub Desktop.
App component which renders the data
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