manga details done

This commit is contained in:
Aria Moradi
2021-01-19 20:20:28 +03:30
parent 590be4f04b
commit 0b2d49f3f6
12 changed files with 283 additions and 67 deletions

View File

@@ -0,0 +1,24 @@
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>
</>
);
}