Skip to content

[4주차] 한서정 미션 제출합니다. #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

xseojungx
Copy link

배포 링크

링크

배운점& 느낀점

시험기간과 여러 중요한 일정들이 너무 겹쳐서 이번 미션은 구현해야하는 기능들의 최소한만 구현하게 되었습니다... 코드에 부족한 점이 많아요ㅜㅜㅠ 죄송합니다 다음주 미션은 200퍼센트로 완성하겠습니다..ㅠㅜㅠㅠ

추가로 채팅방 생성 페이지를 만들었습니다. 근데 채팅방 추가 후 채팅 리스트에도 보이도록 만드려면 데이터 구조를 갈아 엎어야 하는데 그럴 시간이 정말 없어서 구현 못한 점 양해 부탁드립니다..ㅜㅠ

key question

React Router의 동적 라우팅이란 무엇이며, 언제 사용하나요?

  • URL 파라미터를 실제 컴포넌트 경로에 매핑해 주는 기능
  • 예를 들어 /posts/:postId 같은 형태로 여러 개의 상세 페이지를 한 번에 처리할 때 사용
  • 서버에서 데이터를 받아와야 할 때, 또는 사용자별·아이템별 페이지를 유연하게 만들고 싶을 때 유용

느린 네트워크 환경에서 UX를 개선하기 위한 전략과 최적화 방법

  • 지연 로딩(Lazy Loading)
    • 화면에 보이는 부분만 먼저 렌더링하고, 나머지는 스크롤 시나 사용자 동작에 따라 불러오기
  • 스켈레톤 스크린(Skeleton Screen)
    • 로딩 동안 빈 박스 형태의 플레이스홀더를 보여 주면 사용자에게 ‘곧 뜰 거야’라는 느낌을 줌
  • 이미지·리소스 압축 및 CDN 활용
    • 이미지 포맷(WebP) 전환, 크기 조절, 코드 스플리팅으로 초기 로드 파일 크기를 줄이기
    • CDN으로 정적 파일 배포하면 전송 속도 개선
  • 서비스 워커와 캐싱
    • 이전에 불러온 데이터나 에셋을 브라우저에 저장해 차후 네트워크 요청 없이 빠르게 보여주기

useState·useReducer vs. Context API vs. 전역 상태 라이브러리 차이

  • useState / useReducer
    • 컴포넌트 내부 상태 관리에 적합
    • 간단한 폼, 토글, 카운터처럼 국소적인 로직에 사용
  • Context API
    • 여러 컴포넌트에 걸쳐 ‘공유되어야’ 할 때 사용
    • 테마, 로그인 정보 같은 전역값을 prop drilling 없이 전달
  • Redux·Recoil 같은 전역 상태 라이브러리
    • 데이터 변경 로직이 복잡하거나, 비동기 액션(서버 요청), 미들웨어 관리가 필요할 때
    • 상태 업데이트 흐름을 더 명확하게 추적해야 할 때 적합

Copy link

@seoyeon5117 seoyeon5117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4주차 과제 수고하셨습니다!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터는 json 파일로 작성하면 더 좋을 것 같아요!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete.svg랑 같은 파일 같아요

onClick,
}) => {
return (
<button

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button type 기본이 submit이라 따로 지정해주면 좋을 것 같습니다!

const search = '';
const [selectedId, setSelectedId] = useState<number | null>(null);

const filtered = cafes.filter((c: Cafe) => c.name.includes(search.trim()));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변수명을 좀 더 정확히 해주면 좋을 것 같습니다!

type === 'white'
? 'border-b-gray-100 bg-white text-black'
: 'text-white [background:var(--Green-gradient,linear-gradient(0deg,rgba(0,0,0,0.10)_0%,rgba(0,0,0,0.10)_100%),linear-gradient(90deg,#5AE587_0%,#16BBC5_100%))]'
}`}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cn utils 활용하면 더 편하게 코드 작성할 수 있을 것 같아요!

<div className="relative flex w-full items-center self-stretch">
{/* 왼쪽 아이콘 */}
<div
className="absolute top-1/2 left-0 -translate-x-0 -translate-y-1/2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button 태그 사용하면 좋을 것 같아요!

<nav className="absolute right-0 bottom-0 left-0 flex h-[5.25rem] items-start justify-center gap-[2.0625rem] bg-white px-5 pt-2 pb-0 shadow-[0px_-10px_20px_0px_rgba(0,0,0,0.03)]">
{navItems.map((item, i) => (
<button
key={i}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key는 index 말고 고유한 값을 지정해주세요!


@layer components {
.h1 {
@apply text-[60px] leading-[140%] font-bold tracking-[-0.01em];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text는 rem 단위를 쓰는게 적절할 것 같습니다

const location = useLocation();
const nav = useNavigate();

const navItems = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수는 대문자로 써주면 더 좋을 것 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants