본문 바로가기

전체 글66

[TIL] 2주차 - 1. 실무적인 폴더구조 Container/ Presenter 폴더구조 체계화 Container / Presenter 패턴 : js(JSX)와 html을 나누는 방식 (-> 기존에 가장 많이 사용되는 방식) 파일은 두개로 나누지만 하나로 실행시키는 것입니다. Presenter는 화면에 보여지는 부분입니다. container 측에서 presenter를 import 받아와서 사용합니다. container/presenter 패턴 외에도 파일과 폴더를 잘게 쪼개는 방식의 atomic 패턴이 있습니다. presenter 인 BoardWriteUI를 container로 import 받아왔습니다. return() 안에 태그로 presenter를 표현합니다. 그런데 container와 presenter 두개의 파일은 합쳐지지만 writer 변수와 handleChangeWriter.. 2022. 1. 17.
[Git] push하고 보니 commit message 잘못 적었다.. 실컷 커밋하고 푸쉬했는데 커밋메시지를 잘못 적었다..! 구글링하여 내가 선택한 방법은 가장 마지막 커밋한 메시지를 변경하여 강제 푸쉬하는 방법이다. $ git commit --amend -m "변경할 커밋 메시지" 마지막 커밋 메세지를 변경하기 $ git push origin [브랜치명] -f 강제로 푸쉬해준다. 해결. 그밖의 커밋 메시지 취소하는 명령어 $git commit --amend 마지막 커밋 취소. $git reset HEAD^^ 커밋 2개 취소 ^ 개수에 따라 커밋 개수 삭제 (1개만 취소할거면 ^ 한개) $git log 커밋 메시지 리스트 조회 리스트 조회 창 나올 때는 q . . 협업 시 충돌이 날 우려가 있으므로 커밋 취소 명령어는 최대한 사용하지 않는 것이 좋다. 커밋은 신중하게! 2022. 1. 15.
[GitError] error: The following untracked working tree files would be overwritten by merge: ~~ Please move or remove them before you merge. 상황1 아직 작업이 안끝나서 커밋할 수 없는데 pull 받아야 하는 상황 상황2 풀 받다가 현재 작업 중이던 코드와 충돌하여 에러 발생 상황2의 에러문구 error: The following untracked working tree files would be overwritten by merge: [~~~~] Please move or remove them before you merge. $ git clean -d -f -f 위 명령어를 사용하여 워킹트리를 비워주고 pull 받을 수 있지만 지금까지 작업하던 코드를 날리는 방법이라 추천하지 않습니다. 현재 작업 중이던 변경 사항을 임시 저장하고 pull 받은 뒤에 임시 저장 해뒀던 코드들을 다시 불러올 수 있다. $ git add -A 현재 디렉토리 외 .. 2022. 1. 14.
[React Error]Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed.. 문제 상황 styled components 작성 후 실행하려는데 에러가 났다. Server Error Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. 요소 타입이 유효하지 않다고 한다. 아마도 오타가 있거나 빼먹고 만들어주지 않은 태그가 있는 듯하다. 해결 태그명이 안맞았던 .. 2022. 1. 14.