inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

따라하며 배우는 리액트 A-Z[19버전 반영]

react-netflix-clone 오류 문의

478

컴공과

작성한 질문수 17

0

안녕하세요!

react-netflix-clone의 메인 페이지에서 발생한 오류에 대해 문의 드립니다.

문의1) key={movies.id} 에 대해 "list should have a unique "key" prop" 오류가 발생합니다.

Row.js
...
<div id={id} className='row__posters'>
   {movies.map((movie) => (
             <SwiperSlide>
                <img 
                     key={movie.id}
                     style={{ padding: "25px 0" }}
                     className={`row__poster ${isLargeRow && "row__posterLarge"}`}
                     src={`https://image.tmdb.org/t/p/original/${
                             isLargeRow ? movie.poster_path : movie.backdrop_path
                          }`}
                     alt={movie.name}
                     onClick={() => { imageClickHandler(movie) }}
                 />
               </SwiperSlide>
   ))}
</div>

MainPage.js 에서 Row 컴포넌트를 하나만 정의해도 동일한 오류가 발생합니다.

 

문의2) useEffect eslint warning이 안나게 하려면 어떻게 해야 하나요?

useEffect(() => {
        fetchMovieData();
    }, []);

==> warning
WARNING in [eslint] 
src/components/Row.js
  Line 24:8:  React Hook useEffect has a missing dependency: 'fetchMovieData'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

 

문의3) autoprefixer warning이 안나게 하려면 어떻게 해야 하나요?

warning

WARNING in ./src/components/Banner.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/components/Banner.css)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning

(75:5) autoprefixer: start value has mixed support, consider using flex-start instead

Banner.css (제공 소스 그대로 적용함)

.banner {
    color: white;
    object-fit: contain;
    height: 448px;
  }
  @media (min-width: 1500px) {
    .banner {
      position: relative;
      height: 600px;
    }
    .banner--fadeBottom {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: 40rem;
    }
  }
  @media (max-width: 768px) {
    .banner__contents {
      width: min-content !important;
      padding-left: 2.3rem;
      margin-left: 0px !important;
    }
    .banner__description {
      font-size: 0.8rem !important;
      width: auto !important;
    }
    .info {
      text-align: start;
      padding-right: 1.2rem;
    }
    .space {
      margin-left: 6px;
    }
    .banner__button {
      font-size: 0.8rem !important;
      border-radius: 4px !important;
    }
  }
  .banner__contents {
    margin-left: 40px;
    padding-top: 140px;
    height: 190px;
  }
  .banner__title {
    font-size: 3rem;
    font-weight: 800;
    padding-bottom: 0.5rem;
  }
  .banner__description {
    width: 45rem;
    line-height: 1.3;
    padding-top: 1rem;
    font-weight: 500;
    font-size: 1rem;
    max-width: 400px;
    height: 80px;
  }
  .banner--fadeBottom {
    height: 7.4rem;
    background-image: linear-gradient(
      180deg,
      transparent,
      rgba(37, 37, 37, 0.61),
      #111
    );
  }
  .banner__buttons {
    display: flex;
    flex-direction: row;
  }
  .banner__button {
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
    cursor: pointer;
    outline: none;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.2vw;
    padding: 0.4rem 1.8rem 0.4rem 1rem;
    margin-right: 1rem;
  }
  .banner__button:hover {
    color: #000;
    background-color: rgba(170, 170, 170, 0.9);
    transition: all 0.2s;
  }
  .play {
    background-color: white;
    color: black;
  }
  .info {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
  }
  .info:hover {
    background-color: rgb(74, 74, 74);
    color: white;
  }
  
  .space {
    margin-left: 4px;
  }

redux typescript react next.js tdd Next.js

답변 0

강의 소스 코드 압축 풀기 오류

0

72

1

런타임 에러 ㅠㅠ

0

87

1

강의대로 따라갔는데 에러보다 api키로 들어간 넷플릭스? 그런게 렌더링 되지 않습니다 ㅠ

0

104

1

안녕하세요 개발과 상관없는 질문입니다만

0

112

1

리액트 라우터 관련

0

104

1

react-beatiful-dnd에서 문제가 발생합니다.

0

104

1

react19에서는 react-beautiful-dnd가 설치되지 않습니다.

0

816

1

useEffect로 사용을 해도 되나요?

0

201

1

넷플릭스 오리지널 제외하고 슬라이드가 동작을 안합니다.

0

195

1

react 19의 useActionState가 더이상 isPending은 지원하지 않는 듯합니다

0

282

2

리액트 dockderfile 작성 시 COPY 질문

0

149

1

next.js에서부터는 react query 필요없는지

0

320

1

기능

0

197

1

오류가 안보여요

0

197

1

CSS

0

219

1

local storage

0

212

1

list컴포넌트 생성하기

0

224

1

검색어 입력 후 초기화하는 방법 궁금합니다!

0

333

1

Banner.css에 대해서

0

448

1

플러그인이 추천을 안해줍니다

0

323

1

마이너스버튼 테스트

0

279

2

리액트 서버 실행 오류

0

1157

2

오류메세지는 확인했는데 어떻게 고쳐야 할지 모르겠습니다 ㅠ

0

298

1

creactStore질문이요

1

285

2