import React, {useEffect, useState} from "react"; import { useParams } from 'react-router-dom'; function Article(prop) { console.log(prop) let listItem = [] listItem = prop.images.map((el)=>{ return( <img src={`http://localhost:8080/${el}`} alt={`http://localhost:8080/${el}`} style={{ width: "100px", height: "100px"}}/> )}); return ( <div> <h1>{prop.title}</h1> <h2>{prop.author}</h2> <p>{prop.content}</p> <p>{listItem}</p> {/* 게시글의 내용을 렌더링합니다. */} </div> ); } export default Article;