import React , { FC , useState , useEffect } from 'react' ; import axios from 'axios' ; type Issue = { number : number ; title : string ; url : string ; state : string ; } ; const Issues = ( ) => { const [ issues , setIssues ] = useState < Issue [ ] > ( [ ] ) ; useEffect ( ( ) => { axios . get ( 'https://api.github.com/repos/ContentPI/ContentPI/issues' ) . then ( ( response ) => { setIssues ( response . data ) ; } ) ; } , [ ] ) ; return ( < > < h1 > ContentPI Issues < /h1> { issues . map ( ( issue ) => ( < p > < strong > # { issue . number } < /strong> {' '} < a href = { `https://github.com/ContentPI/ContentPI/issues/${ issue . number }` } target = "_blank" > { issue . title } < /a> {' '} { issue . state } < /p>))} < />); } ; export default Issues ;