-
Notifications
You must be signed in to change notification settings - Fork 47
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
Change the as
prop to allow all element types and button to allow as
prop
#1899
Conversation
|
Name | Type |
---|---|
@channel.io/bezier-react | Major |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Chromatic Report🚀 Congratulations! Your build was successful! |
@@ -113,6 +114,8 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button | |||
onClick, | |||
...rest | |||
}, forwardedRef) { | |||
const Comp = as as 'button' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타입 에러때문에 단언을 하신걸까요?
const Comp = as as 'button' | |
const Comp = as |
이렇게만 해도 에러가 안뜨네요. 아니면 L101에서 as: Comp = 'button' 으로 해도 될거같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러는 안뜨는데, any로 추론되어 jsx 부분에서 컴파일러가 제대로 동작하지 않는 문제가 있어 추가했어요!
9614a97
to
2303239
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## alpha #1899 +/- ##
=======================================
Coverage 86.40% 86.41%
=======================================
Files 249 249
Lines 3420 3422 +2
Branches 747 748 +1
=======================================
+ Hits 2955 2957 +2
Misses 384 384
Partials 81 81 ☔ View full report in Codecov by Sentry. |
Self Checklist
Related Issue
Summary
Change the
as
prop to allow all element types and button to allowas
propDetails
Button
또한 마찬가지로 Link, a 태그 등으로 사용되는 케이스들이 있습니다. as 속성을 지원하도록 개선했습니다.Breaking change? (Yes/No)
No