인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

gong48572530's profile image
gong48572530

asked

A real introductory all-in-one development boot camp for non-majors

[Grab Market] Web Development with React - 2

키보드 사진이 안떠요 ㅜㅜ

Written on

·

215

0

import "./index.css";
import axios from "axios";
import React from "react";

function MainPage() {
  const [products, setProducts] = React.useState([]);
  axios
    .get("https://6ca5df92-90b1-4b71-a335-3620d8a9bbd0.mock.pstmn.io/products")
    .then(function (result) {
      const products = result.data.products;
      setProducts(products);
    })
    .catch(function (error) {
      console.error("에러 발생:", error);
    });
  return (
    <div>
      <div id="header">
        <div id="header-area">
          <img src="images/icons/logo.png" />
        </div>
      </div>
      <div id="body">
        <div id="banner">
          <img src="images/banners/banner1.png" />
        </div>
        <h1>판매되는 상품들</h1>
        <div id="product-list">
          {products.map(function (product, index) {
            return (
              <div className="product-card">
                <div>
                  <img
                    className="product-img"
                    src="images/products/keyboard1.jpg"
                  />
                </div>
                <div className="product-contents">
                  <span className="product-name">키보드</span>
                  <span className="product-price">50000원</span>
                  <div className="product-seller">
                    <img
                      className="product-avatar"
                      src="images/icons/avatar.png"
                    />
                    <span>그랩</span>
                  </div>
                </div>
              </div>
            );
          })}
        </div>
      </div>
      <div id="footer"></div>
    </div>
  );
}

export default MainPage;
react-nativeexpresstensorflownodejs머신러닝 배워볼래요? reactjavascriptHTML/CSS

Answer 1

0

grab님의 프로필 이미지
grab
Instructor

브라우저에서 어떤 화면이 보이는지, 또 개발자 도구의 Console창에 어떤 로그가 보이는 지 함께 올려주시면 확인이 가능할 것 같아요~!

gong48572530's profile image
gong48572530

asked

Ask a question