Skip to content

Code Convention

jin-Pro edited this page Sep 25, 2022 · 2 revisions

[ Alias ]

  • Component => @Component
  • Hook => @Hook
  • Page => @Page

[ 폴더구조 예시 ]

- Component
  - Button
    - index.ts
    - Button.tsx // in Style, Type , ...
    - Button.hook.tsx
    - Button.util.tsx
  ...

[ constant : SNAKE_CASE (with Capital Letter) ]

export const SUCCESS_MESSAGE = '성공!' ✅
export const successMessage ='성공!' ❌

[ variable : camelCase ]

const inputVariable ✅
const InputVariable ❌

[ function : camelCase ] => 함수형

const handleClick = () => {} ✅
const handle_click = () => {} ❌

[ component : PascalCase ]

const FunctionalComponent = ({...props}) => {} ✅
const functionalComponent = ({...props}) => {} ❌

[ Type ]

type Props = { ... } ✅
interface Props { ... } ❌

[ CSS ]

[ 전역 상태 관리 ]

  • 전역상태는 우선 context => 나중에 고민

[ 서버 상태 관리 ]

  • 나중에

Clone this wiki locally