Skip to content

[Step2] hippo - Props와 State - #2

Open
meteorqz6 wants to merge 6 commits into
hippo-step1from
hippo-step2
Open

[Step2] hippo - Props와 State#2
meteorqz6 wants to merge 6 commits into
hippo-step1from
hippo-step2

Conversation

@meteorqz6

@meteorqz6 meteorqz6 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

개인 목표 달성 여부

  • Props를 통해 부모 컴포넌트에서 자식 컴포넌트로 데이터를 전달하는 방식 이해하기
  • State를 사용해 컴포넌트 내부의 동적 상태 관리하기
  • Props와 State를 조합하여 부모-자식 간 양방향 데이터 흐름 구현하기

리뷰어에게

특히 봐줬으면 하는 부분, 확신이 없는 코드, 논의하고 싶은 것

  • 상수와 유틸 함수를 별도 파일로 분리하여 리팩토링했습니다.
  • 동적 데이터 매핑을 어떤 식으로 구현했는지 논의하면 좋을 것 같습니다.

@meteorqz6
meteorqz6 marked this pull request as draft June 3, 2026 00:43
@meteorqz6 meteorqz6 changed the title Hippo step2 [Props와 State] - hippo Jun 3, 2026
@meteorqz6 meteorqz6 changed the title [Props와 State] - hippo [Step2] hippo - Props와 State Jun 3, 2026
@meteorqz6
meteorqz6 marked this pull request as ready for review June 3, 2026 10:04
@@ -0,0 +1,32 @@
import styles from "./RestaurantList.module.css";
import { CATEGORY_IMAGES } from "../../constants/categoryImages.js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[배움]
이미지를 아예 상수 파일로 분리하셨네요! 보기에도 깔끔하고, 유지 보수에도 더 좋은 구조인 것 같아서 저도 적용해보고 싶습니다.

Comment on lines +5 to +9
return (
<section className={styles.restaurantList}>
<ul>
{restaurants.map((restaurant) => {
return (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[제안]
저는 <section>, <ul> 태그의 return는 그대로 두고 <li> 태그만 map() 안쪽으로 옮겨주었는데, 결과는 같겠지만 렌더링 방식이나 효율에서 어떤 차이가 나는지 이야기해보면 좋을 것 같습니다!

Comment on lines +1 to +6
export function filterRestaurants(restaurants, category) {
if (category === "전체") return restaurants;
else {
return restaurants.filter((restaurant) => restaurant.category === category);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[질문]
레스토랑 필터 적용 로직을 util 파일로 분리하신 점이 새로운 것 같습니다!
저는 해당 부분이 크게 복잡하거나 활용도가 높지 않다고 생각해서 그냥 App 파일에 넣어주었는데, 혹시 분리하신 이유가 있을까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

필터 계산 로직은 UI와 무관한 순수 함수이므로, utils/로 분리해서 이 파일은 UI를 담당하지 않는다는 의도를 명확히 할 수 있다고 생각합니다.

Comment thread src/App.jsx
Comment on lines +13 to +17
const filteredRestaurants = filterRestaurants(RESTAURANTS, category);

function handleChange(e) {
setCategory(e.target.value);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[제안]
핸들러를 먼저 만들어서 카테고리 필터에 넘겨주셨네요.
전 요구사항을 그대로 반영해서 이런 방식을 생각해보지 못했는데, 핸들러가 어떤 파일에 있는 것이 더 자연스러운지 스터디 때 이야기해보면 좋을 것 같아요!

@meteorqz6
meteorqz6 changed the base branch from step2 to hippo-step1 June 6, 2026 09:54
@meteorqz6 meteorqz6 self-assigned this Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f7e4c6ce-ae34-4b62-9964-5577cf2a125f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hippo-step2

Comment @coderabbitai help to get the list of available commands and usage tips.

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