[Nextjs] Binding element 'children' implicitly has an 'any' type

오도원공육사·2023년 1월 17일
0

Nextjs

목록 보기
1/1

children의 타입을 지정해준다.

import { ReactNode } from 'react';

interface Props {
  children: ReactNode;
}

export default function Layout({ children }: Props) {
  return (
    <>
      <Header />
      <div>{ children }</div>
      <Footer />
    </>
  );
}

참고.
https://stackoverflow.com/questions/55370851/how-to-fix-binding-element-children-implicitly-has-an-any-type-ts7031

profile
잘 먹고 잘살기

0개의 댓글