import axios from 'axios'; import React, { useEffect, useState } from 'react'; import { Modal, Container, Row, Button, } from 'react-bootstrap'; function Place(props) { const [reviews, setReviews] = useState([{ title: "", link: "", summery: "", content: "" }]) const getReview = () => { axios.get(`/api/review/${props.search.name}`)//review를 서버에 연결해서 .then(res => {s console.log("place res.data", res.data) setReviews(res.data) }) .catch(err => { console.log(err) }) } useEffect(() => { getReview(); }, []) return ( {props.index + 1}. {props.search.name} {reviews.map((review, index) => { return ( {review.title}
{review.summary}
{review.content}
) })}
); } export default Place;