Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created August 8, 2019 17:05
Show Gist options
  • Save vsavkin/76496e82ae77c6efb85fc8b333ff68c7 to your computer and use it in GitHub Desktop.
Save vsavkin/76496e82ae77c6efb85fc8b333ff68c7 to your computer and use it in GitHub Desktop.
import React, { useState, useEffect } from 'react';
import { Ticket } from '@happyorg/data';
export const App = () => {
const [tickets, setTickets] = useState<Ticket[]>([]);
useEffect(() => {
fetch('/api/tickets')
.then(t => t.json())
.then(setTickets);
}, []);
//...
};
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment