-
-
Notifications
You must be signed in to change notification settings - Fork 430
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(button.tsx): Button as
prop internal logic + TS props
#885
Conversation
In Next the Link component uses `href`. The preivous condition was always renderinng the button as achor tag when href was provided. Now if `as` is provided it always render the defined tag/component fix themesberg#865
…t the props of the tag/component passed
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #885 +/- ##
==========================================
- Coverage 99.54% 99.53% -0.02%
==========================================
Files 163 167 +4
Lines 6621 6902 +281
Branches 401 417 +16
==========================================
+ Hits 6591 6870 +279
- Misses 30 32 +2
☔ View full report in Codecov by Sentry. |
Hi there, https://codesandbox.io/p/sandbox/epic-khayyam-87pg9k?file=%2Fpages%2Findex.tsx It looks like the following code triggers a typechecker error:
(Though Am I missing something? |
Yes, you didn't updated you flowbite-react and still using |
https://codesandbox.io/p/sandbox/button-as-3jpqss?file=%2Fpages%2Findex.tsx%3A9%2C63 Apologies! I didn't paste the correct link... In this sandbox, even though the 3 buttons render, there's a typechecker error. |
@shixiao this is really weird, I don't see the same issue at the docs project. Anyway, please, open an issue. |
Summarize the changes made and the motivation behind them.
This fixes the issue with Next
Link
component which also uses thehref
prop (which the internal logic was always rendering an anchor tag).It also improves the TS props of Button and DropdownItem components to actually inherit the props of the tag/component passed in the
as
prop, instead of usingextends Record<string, unknown>
.Reference related issues using
#
followed by the issue number.Fix #865