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

[Fix] : Table 컴포넌트의 상위 context가 존재하지 않아도 useContext 에러가 발생하지 않도록 수정해요. #174

Merged
merged 4 commits into from
Nov 24, 2024

Conversation

eugene028
Copy link
Collaborator

🎉 변경 사항

Table 컴포넌트에서 useSafeContext 훅을 사용하고 있었는데, 상위 컨텍스트가 존재하지 않으면 Error를 throw하는 로직을 갖고 있었어요.
Table 컴포넌트는 checkbox로직을 사용하지 않으면 context를 사용하지 않을 수도 있어요..!!
이를 보완하기 위하여 useSafeContext를 사용하는 대신, context가 null 일때, 기본 객체 값을 리턴할 수 있도록 하여
Context를 사용하던 사용하지 않던 에러가 발생하지 않도록 했어요.

🚩 관련 이슈

#173

🙏 여기는 꼭 봐주세요!

@hamo-o
이제 와우 클래스에서 불필요하게 Table 컨텍스트로 감쌌던 로직을 제거해도 문제가 생기지 않을 거예요.

Copy link

changeset-bot bot commented Nov 9, 2024

🦋 Changeset detected

Latest commit: b797e09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wowds-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 9, 2024

Copy link
Contributor

github-actions bot commented Nov 9, 2024

Copy link
Contributor

github-actions bot commented Nov 9, 2024

@SeieunYoo SeieunYoo linked an issue Nov 10, 2024 that may be closed by this pull request
1 task
Copy link
Collaborator

@SeieunYoo SeieunYoo left a comment

Choose a reason for hiding this comment

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

🚀~

Copy link
Member

@hamo-o hamo-o left a comment

Choose a reason for hiding this comment

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

조씁니다 🚀🚀

packages/wow-ui/src/components/Table/TableContext.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@eugene028 eugene028 merged commit bcc0eee into main Nov 24, 2024
3 checks passed
@eugene028 eugene028 deleted the fix/table-context branch November 24, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Table 컴포넌트 Tr value값 필수 문제
3 participants