themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.78k stars 396 forks source link

fix(button): Fixed Typescript error when using Next.js Link in the button `as` prop #1244

Closed nigellima closed 5 months ago

nigellima commented 5 months ago

Summarize the changes made and the motivation behind them. This PR fixes the Typescript error when the Next Link component was passed to the Button as prop. The error is now fixed and the props inference of the component/element passed to the as prop still works properly

Reference related issues using # followed by the issue number.

fix #1002 fix #1107

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 0:17am
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7461173) 99.54% compared to head (3c8b062) 97.38%. Report is 190 commits behind head on main.

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rnicholus commented 4 months ago

This seems to have introduced some regressions. Why is the return type of Button now React.ReactNode instead of JSX.Element? Same question for Dropdown.Item.

This issue occurred previously. Reported in #962 and fixed in #974.