개발일지/항해 99
-
[항해 99 WIL] Life cycle && React Hooks개발일지/항해 99 2023. 7. 10. 00:22
Life cycle 생명주기라고도 불리는 이것은 컴포넌트가 생성되는 순간부터 사라지는 순간까지의 과정에서 어떠한 메서드가 실행이 되는지를 알 수 있는 것으로 클래스형컴포넌트를 많이 사용하는 그떄에는 필수적으로 알고있어야하지만 현재는 함수형컴포넌트가 대중화가 되고 클래스형 컴포넌트의 사용이 줄어들어 자세하게는 알 필요가 없다고 생각이 든다. 하지만 그중에서도 3가지는 알아야하는데 그게 마운트, 업데이트, 언마운트이다. 마운트 컴포넌트가 생성이 되었을 때를 나타내는 것으로 페이지가 랜더링되는것과 함수가 생성 및 실행되는 것이 모두 여기 담겨있다고 보면 된다 업데이트 state의 변화 props의 변화로 그리고 강제 업데이트로 인해서 리랜더링이 되었을때를 나타내는 것이라고 보면 된다 언마운트 함수가 사라졌을 ..
-
[항해99 회고록] 3주차 주특기 Level-3 과제개발일지/항해 99 2023. 7. 8. 11:34
이번 level3과제는 재활용할 수 있는 컴포넌트 만들기가 주제인듯하다. 그래서 좀 더 아쉬움이 많이 남는다. 먼저 혜경님과 페어가 되어서 진행을 하게 되었는데 많이 잘 이끌어주셔서 너무 고마웠다. 부족했던 점 css를 사용하는 부분에서 혜경님의 도움을 많이 받아서 조금 수월하게 진행을 할 수 있었다. 기술적으로 자문을 많이구해서 조금 귀찮아하셨을까 걱정이였지만 다행이도 티는 내지 않으셨다..ㅎ 컴포넌트 재활용의 개념에 대해서 이해가 조금 부족한 것같다 props를 전달하는 과정에서 조금 간소화를 시키고 공통된 부분을 모아서 구성해야하는데 이부분에 대해서 이해가 좀 덜 되서 모달창을 만들 때 특히나 갈피를 잘 못잡은 것 같다. git사용부분에 있어서 처음에 많은 시행착오를 거치게 되어버려서 시간을 많이 ..
-
[항해 99 주특기] 심화강의 Thunk개발일지/항해 99 2023. 7. 4. 00:18
미들웨어란 서버와의 통신에 사용하는 것이 대부분이다. 리덕스에서 가장 많이 사용되는 미들웨어는 청크와 사가가 있고 리액트 쿼리도 비슷한 역할을 한다. 청크는 디스팰치안에 객체를 넣었었는데 함수를 디스패치할 수 있게 해줌으로써 어떠한 동작을 실행 할 ㅅ ㅜ있게 해주는 특징이 있다. 미들웨어가 없을 때는 컴포넌트에서 변화가 일어날때 액션이 리듀서로 전달되고 이게 스토어에 값에 변화를 일으킨다. 디스패치되자마자 액션이 리듀서로 보내져서 새로운 state를 반환하기에 중간에 끼어들 틈이 없었다 미들웨어를 사용하면 이 과정사이에 우리가 하고싶은 작업을 할 수있다. ex) conter에서 1더하기를 눌렀을 때 3초있다가 1을 더하고 싶을 때 사용하는데 대부분의 사용되는 경우는 서버와의 통신을 위해 사용하는 것이기에..