import React, { useEffect, useState } from 'react' import { Link } from 'react-router-dom' import axios from 'axios' import { API_BASE_URL, SITE_TITLE } from '../config' const HomePage = () => { const [posts, setPosts] = useState([]) useEffect(() => { const fetchPosts = async () => { try { const response = await axios.get(`${ API_BASE_URL }/posts`) setPosts(response.data) } catch (error) { console.error('Failed to fetch posts:', error) } } fetchPosts() document.title = `${ SITE_TITLE } 〜 ぼざクリも、ぼざろ外も、外伝もあるんだよ。` }, []) return (
{posts.map (post => ( ))}
) } export default HomePage