[next.js] reactstrap 적용

하태현·2021년 4월 14일
0

next.js 세팅을 완료하고 보니 reactstrap이 안먹힌다.

아래의 코드를 pages/_app.tsx에 추가 해준다.

head 태그에 cdn을 추가해주면 되는거였다.

이 글을 보시는 분들은 이렇게 간단한 작업 때문에 나처럼 몇시간을 허비하지 않기를 바라며....

import '../index.css'
import { appWithTranslation } from 'next-i18next'
// i18next: 번역 라이브러리(궁금 하실까봐^^)
import type { AppProps } from 'next/app'
import Head from 'next/head'

const MyApp = ({ Component, pageProps }: AppProps) => {
  return (
    <>
      <Head>
        <link
          rel="stylesheet"
          href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
          integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
          crossOrigin="anonymous"
        />
      </Head>
      <Component {...pageProps} />
    </>
  )
}

export default appWithTranslation(MyApp)

Reference

Cooking a Deliveroo clone with Next.js (React), GraphQL, Strapi and Stripe - 🏗️ Setup (part 1/7)

나중에 이분 블로그 part 7까지 정독해야겠다

profile
왜?를 생각하며 개발하기, 다양한 프로젝트를 경험하는 것 또한 중요하지만 내가 사용하는 기술이 어떤 배경과 이유에서 만들어진 건지, 코드를 작성할 때에도 이게 최선의 방법인지를 끊임없이 질문하고 고민하자. 이 과정은 앞으로 개발자로 커리어를 쌓아 나갈 때 중요한 발판이 될 것이다.

0개의 댓글