-
-
Notifications
You must be signed in to change notification settings - Fork 421
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): Fixed Typescript error when using Next.js Link in the button as
prop
#1244
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`as` prop was throwing TS errors when using Next Link component. Now this correctly infers the type from any component passed to the `as` prop fix themesberg#1002 fix themesberg#1107
…o wraps it with a forwardRef
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1244 +/- ##
==========================================
- Coverage 99.54% 97.38% -2.17%
==========================================
Files 163 216 +53
Lines 6621 9217 +2596
Branches 401 538 +137
==========================================
+ Hits 6591 8976 +2385
- Misses 30 241 +211 ☔ View full report in Codecov by Sentry. |
1 task
SutuSebastian
approved these changes
Jan 24, 2024
abdulbasithqb
pushed a commit
to abdulbasithqb/flowbite-react
that referenced
this pull request
Jan 31, 2024
…tton `as` prop (themesberg#1244) * fix(button): correctly infer type from `as` prop `as` prop was throwing TS errors when using Next Link component. Now this correctly infers the type from any component passed to the `as` prop fix themesberg#1002 fix themesberg#1107 * fix(dropdown-item): applied the generic types to DropdownItem and also wraps it with a forwardRef * docs(button): removed now-unnecessary @ts-expect-error comments * fix(button): replaced use of old genericForwardRef
abdulbasithqb
pushed a commit
to abdulbasithqb/flowbite-react
that referenced
this pull request
Jan 31, 2024
…tton `as` prop (themesberg#1244) * fix(button): correctly infer type from `as` prop `as` prop was throwing TS errors when using Next Link component. Now this correctly infers the type from any component passed to the `as` prop fix themesberg#1002 fix themesberg#1107 * fix(dropdown-item): applied the generic types to DropdownItem and also wraps it with a forwardRef * docs(button): removed now-unnecessary @ts-expect-error comments * fix(button): replaced use of old genericForwardRef
2 tasks
rnicholus
added a commit
to BigleafNetworks/flowbite-react
that referenced
this pull request
Mar 14, 2024
…tem to JSX.Element In themesberg#1244, the return type of Button and DropdownItem was changed to ReactNode. This is not an acceptable return type for functional components. The correct return type is JSX.Element. This change fixes the regression from that PR (introduced in v v0.7.3 A Also fixes themesberg#962. fix themesberg#962
Closed
1 task
rnicholus
added a commit
to BigleafNetworks/flowbite-react
that referenced
this pull request
Mar 14, 2024
…n the button `as` prop (themesberg#1244)" This reverts commit a6698d4.
Merged
This was referenced May 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summarize the changes made and the motivation behind them.
This PR fixes the Typescript error when the Next
Link
component was passed to the Buttonas
prop.The error is now fixed and the props inference of the component/element passed to the
as
prop still works properlyReference related issues using
#
followed by the issue number.fix #1002 fix #1107