Files
suwayomi-material-you-webui/webUI/react/src/components/MangaDetails.tsx

25 lines
527 B
TypeScript
Raw Normal View History

2021-01-19 20:20:28 +03:30
import React, { useEffect, useState } from 'react';
interface IProps{
id: string
}
export default function MangaDetails(props: IProps) {
const { id } = props;
const [manga, setManga] = useState<IManga>();
useEffect(() => {
fetch(`http://127.0.0.1:4567/api/v1/manga/${id}/`)
.then((response) => response.json())
.then((data) => setManga(data));
}, []);
return (
<>
<h1>
{manga && manga.title}
</h1>
</>
);
}