쇼핑몰 마켓을 만든 이유는 4주 프로젝트를 하면서 조금더 학습하고 부족한 점을 보완하기 위해서 만들게 되었다. 처음에는
Redux로 개발하기
사진을 클릭하였을 때 새로운 페이지로 전환하기 위하여 기존에는 를 활용하였다.목업 데이터로 활용할시에는 서버에서 호출을 받지 않았기 때문에 오류가 발생하지 않았지만 사진을 클릭시 페이지 전환과 동시에 useEffect로 특정 조건인 useParams로 받은 id값이 변
정확히 값을 다 설정해줬는데도 렌더링 됐을 때 값이 없다는 에러가 발생하였다. 따라서 출력하기전에 삼항 연산자 또는 (&& 연산자 무고건 true일 때 출력하는 조건)를 설정하여 값이 있을때 때 출력해주는 조건을 걸고 return 값을 렌더링하는 구조로 수정을 하였다.
사진의 제목과 사진의 가격이 상태관리를 하는데 반드시 필요한 데이터 였기 때문에 유효성 검사가 필요했으며 유효성 검사 조건이 성립하는 경우에만 등록 버튼이 활성화 되도록 해야 했다.입력한 결과 값에 따라 상태 변화를 감지하고 데이터값이 유효한지 판별해야 했기 때문에 u
disabled를 mdn에서는 이렇게 설명하고 있다. Boolean disabled 속성이 있는 경우 요소를 변경하거나 포커스할 수 없거나 양식과 함께 제출할 수도 없습니다 내가 구성한 코드 구성상 데이터의 name이 반드시 필요하게 구성되어 있다. reducer에서
모달창 기능 구현은 팀프로젝트에서 한번 해본 경험이 있다. useState값을 불리언(Boolean) 타입으로 설정하는 것이 중요하다onClick 이벤트를 통하여 사진을 클릭시에 함수를 호출하고 상태값을 true로 바꿔주는 형식을 취하였다. modal창 구현은 앞으로도
일단 redux-thunk가 무엇인지 정의를 한번 알아볼 필요가 있다. redux-thunk는 리덕스에서 비동기 작업을 처리 할 때 가장 많이 사용하는 미들웨어이다. 이 미들웨어를 사용하면 액션 객체가 아닌 함수를 디스패치 할 수 있습니다. 여기서 궁금해지는 단어 미들