13 lines
281 B
TypeScript
13 lines
281 B
TypeScript
import { useState, useEffect } from "react";
|
|
|
|
export function BlogList() {
|
|
const [content, setContent] = useState("");
|
|
useEffect(() => {
|
|
fetch(`localhost:8000/get-blogs`)
|
|
.then((res) => res.text())
|
|
.then(setContent);
|
|
}, []);
|
|
|
|
return <div>{content}</div>;
|
|
}
|