zrok/ui/src/Version.js

24 lines
467 B
JavaScript
Raw Normal View History

2022-08-02 17:59:25 +02:00
import {useEffect, useState} from "react";
import * as metadata from "./api/metadata";
const Version = () => {
const [v, setV] = useState('');
useEffect(() => {
let mounted = true;
metadata.version().then(resp => {
if(mounted) {
setV(resp.data);
}
});
return () => {
mounted = false;
};
}, []);
return (
2022-08-03 17:54:11 +02:00
<p>{v}</p>
2022-08-02 17:59:25 +02:00
);
}
export default Version;