• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

ESLint /pages/_app.js 파일의 Component 오류에 대해 궁금합니다.

21.01.20 16:35 작성 조회수 413

0

const Common = ({ Component }) 이부분에서 받아오는 Component에 'Component' is missing in props validation 이라고 에러가 나옵니다.

proptypes가 잘못된건지 어디가 문제인지 찾지를 못하겠습니다ㅠ

import React from 'react';
import PropTypes from 'prop-types';
import Head from 'next/head';

import 'antd/dist/antd.css';

import wrapper from '../store/configureStore';
// 모든페이지에서 공통인 부분
const Common = ({ Component }) => (
<>
<Head>
<meta charSet="utf-8" />
<title>Nodebird</title>
</Head>
<Component />
</>
);

Common.propType = {
Component: PropTypes.elementType.isRequired,
};

export default wrapper.withRedux(Common);

답변 2

·

답변을 작성해보세요.

1

Common.propTypes = { 입니다.

0

으 오타였군요 ㅠ 감사합니당