새로 올라온 게시글을 확인해보세요.
-
-
-
-
사용시 오류 nextjs 이전 단계에서는 잘만 썼던 i18next를 13버전으로 올렸더니 여러가지 이슈들이 터지기 시작한다.. 현재 프로젝트 환경에 맞춰서 i18next를 잘 쓰고 있었는데언어팩 json 에서 html 태그를 사용해야해서 컴포넌트를 이용해야했다. react-i18next 문서를 참고하면서 잘 작성..https://react.i18next.com/latest/trans-component import React from 'react';import { Trans, useTranslation } from 'react-i18next'function MyComponent() { const { t } = useTranslation('myNamespace'); return Hello World;} 대충 위에 .. -
-
-
-
attribute 타입 지정시 TS2322: Type 'StaticImageData' is not assignable to type 'string'. 에러 next.js에서 이미지를 마크업할 때 next/Image 컴포넌트를 주로 이용한다. lazy loading과 이미지 사이즈 최적화, placeholder 기능 등 유용한 쓰임이 있기 때문이다. 이번에 컴포넌트로 분리하는 작업을 하다가, 컴포넌트의 src값을 props로 받아오도록 했는데 언어가 typescript다 보니 props 값의 타입을 지정해줘야 했다. {title} {subTitle} export interface contentProps { title: string; subTitle?: string; background: string; } 위와 같이 background(즉, src의 타입)에 string으로 설정하면 될 줄 알았다...! 하지만 background에 들어갈 값은 import된 ..
-
-