-
-
Notifications
You must be signed in to change notification settings - Fork 441
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: polymorphic component return types [button, dropdown item] #1308
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning Rate Limit Exceeded@SutuSebastian has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 49 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThis update involves refactoring and optimizing component structures within a React project. Specifically, it refines the Changes
Related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Note: vercel preview will fail, due to changed settings for the new monorepo structure. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/components/Button/Button.tsx (2 hunks)
- src/components/Dropdown/DropdownItem.tsx (2 hunks)
Additional comments: 5
src/components/Dropdown/DropdownItem.tsx (2)
- 28-30: The refinement of
DropdownItemComponentType
to specify theprops
parameter more explicitly and adjust the return type toJSX.Element
is a positive change, enhancing type safety and clarity.- 25-35: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [32-65]
The implementation of the
DropdownItem
component correctly utilizesforwardRef
, generics, and context management. The handling of custom themes and conditional rendering of icons is well done. This aligns with best practices for React component development.src/components/Button/Button.tsx (3)
- 91-93: The adjustment of
ButtonComponentType
to ensure a more precise and consistent type definition is a positive change, enhancing type safety and clarity.- 88-98: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [95-171]
The implementation of the
ButtonComponent
correctly utilizesforwardRef
, generics, and theme management. The handling of a wide range of props for customization and conditional class name generation is well done. This aligns with best practices for React component development.
- 175-175: The export structure of the
Button
component, with theGroup
property attached, follows a common pattern for component libraries, promoting a cleaner API surface.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/components/Button/Button.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/components/Button/Button.tsx
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.
LGTM
Tested locally
same, looks good to me |
0.7.4 is completely broken. |
Fixing. |
Check |
thanks! |
Changes
Button
andDropdownItem
being rendered asReact.ReactNode | null
- now returnsJSX.Element
'~/src/helpers/generic-as-prop'
to'../../helpers/generic-as-prop'
Issues
#962
Result