Skip to content
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

CategorySelectBar 렌더링 관련 refectoring #174

Open
pkiop opened this issue Jan 21, 2021 · 0 comments
Open

CategorySelectBar 렌더링 관련 refectoring #174

pkiop opened this issue Jan 21, 2021 · 0 comments
Assignees
Labels
frontend frontend refector refector

Comments

@pkiop
Copy link
Owner

pkiop commented Jan 21, 2021

구현할 내용

image
refectoring

  • DB에서 category 받아왔을 때 이 카테고리를 CategorySelectBar에 주입하고 싶었다.
  • setSelectCategory(category) 로 하려고 했지만 이렇게 하면 무한 rerendering 이 일어난다.
  • let 을 사용해서 fetch가 끝나기 전까진 selectedCategory에 설정된 기본 값 ( ' ' ) 를 통해 categorySelectBar를 rendering하고 이후 fetching 이 끝나면 fetching한 category를 사용해서 렌더링 하는 의미로 위와 같이 작성했다.
  • let을 사용하지 않게 / 더 좋은 방법으로 refectoring하자
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend frontend refector refector
Projects
None yet
Development

No branches or pull requests

1 participant