React Setup

๊ตฌ์„ฑ

  • styled-components

  • recoil

  • react-router-dom

  • react-hook-form

  • react-query

CRA Installation (w/TS)

npx create-react-app my-app --template typescript

Packages

npm i styled-components

// Type definition
npm i --seve-dev @types/styled-components

npm i react-router-dom

npm i recoil

npm i react-hook-form

npm i react-query

ํด๋”๊ตฌ์กฐ

  • ๊ฐ„๋‹จํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋งŒ๋“ค ๋•Œ๋Š” ํด๋” ๊ตฌ์กฐ๊ฐ€ ๊ทธ๋ฆฌ ์ค‘์š”ํ•˜์ง€ ์•Š์•˜์œผ๋‚˜ ์ ์ฐจ ๋ณต์žกํ•ด์ง€๋ฉด์„œ ๊ตฌ์กฐ๋ฅผ ์ •์˜ํ•  ํ•„์š”์„ฑ์„ ๋А๋‚Œ

  • ์•„์ง ํฐ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ฒฝํ—˜ํ•ด๋ณด์ง€ ๋ชป ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ผ๋‹จ์€ ๋‚ด ๊ฒฝํ—˜์„ ํ† ๋Œ€๋กœ ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ๋“ค์„ ๋นผ์„œ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด๋ณด๊ธฐ๋กœ ํ–ˆ์Œ.

public/
    index.html

src/
    App.tsx
    index.tsx
    api/
        api.ts

    components/ -- ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ๊ด€๋ฆฌ
        Button.tsx
        Input.tsx
            Home/ -- ํŠน์ • ํŽ˜์ด์ง€์—์„œ๋งŒ ์‚ฌ์šฉ๋˜๋Š” ์ปดํฌ๋„ŒํŠธ ๊ด€๋ฆฌ
              ImgCard.tsx

    pages/ -- ์ปดํฌ๋„ŒํŠธ๋กœ ๊ตฌ์„ฑ๋œ ํŽ˜์ด์ง€ ๊ด€๋ฆฌ
        LogIn.tsx
        Home.tsx

    routes/ -- router ๊ด€๋ฆฌ
        router.ts

    recoil/ -- atoms ๊ด€๋ฆฌ
        atom.ts

    styles/ -- style ๊ด€๋ จ ํŒŒ์ผ ๊ด€๋ฆฌ
        GlobalStyle.ts
        styled.d.ts
        theme.ts

Last updated