Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import React, { useState, useEffect } from 'react';
  2. import { Ticket } from '@happyorg/data';
  3.  
  4. export const App = () => {
  5. const [tickets, setTickets] = useState<Ticket[]>([]);
  6.  
  7. useEffect(() => {
  8. fetch('/api/tickets')
  9. .then(t => t.json())
  10. .then(setTickets);
  11. }, []);
  12.  
  13. //...
  14. };
  15.  
  16. export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement