멘토님이 말씀해 주신 colocation적용.
예) 컴포넌트를 만들 때
src/components/
에 만들면 됩니다.src/pages/페이지명/components
에 만들면 됩니다.VSCode Extension: ES7+ React/Redux/React-Native snippets
컴포넌트명 폴더 생성 → index.tsx
사용.
export default 컴포넌트명
하단 작성.
rfce
명령어로 컴포넌트 생성.
상단에 import React from 'react'
삭제.
// Hello/index.tsx
// ❎
export default Hello() {
return <div>Hello</div>
}
// ✅
function Hello() {
return <div>Hello</div>
}
export default Hello;