Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import toastr from 'toastr'; import React, { useEffect, useState } from 'react'; import { getVersion } from '../../api_calls'; export default function HomePage() { const [data, setData] = useState([]); useEffect(() => { getVersion() .then(result => setData(result.data)) .catch(error => toastr.error(error)); }, []); return ( <div> <p>Welcome to the about page.</p> <p>Current API version is: {data}</p> <p>Current time is: {new Date().toISOString()}</p> </div> ); } |