import axios from 'axios'; import React, { useEffect, useState } from 'react'; import { Modal, Container, Row, Col, Button, Badge, Card, Accordion, Carousel } from 'react-bootstrap'; function Place(props) { const [reviews, setReviews] = useState([]) const getReview = () => { axios.get(`/api/review/${props.search.name}`) .then(res => { console.log("place res.data", res.data) setReviews(res.data) }) .catch(err => { console.log(err) }) } useEffect(() => { getReview(); }, []) return ( setLgShow(false)} aria-labelledby="example-modal-sizes-title-lg"> {props.index + 1}. {props.search.name} {reviews.map((review, index) => { return ( {review.title}
{review.summary}
{review.content}
) })}
); } export default Place;