-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore(docs): add TS examples for single & multiple selection #3682
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
WalkthroughThe changes introduce TypeScript versions of the dropdown selection components, enhancing type safety and performance. The updated components manage selected keys using TypeScript's type system and React hooks, with improvements in state management and accessibility features. The documentation was also modified to reflect the changes without highlighted lines in code demos. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AppTs
participant Dropdown
User->>AppTs: Select option
AppTs->>Dropdown: Update selectedKeys
Dropdown->>Dropdown: Calculate selectedValue
Dropdown->>User: Display selected value
Assessment against linked issues
Possibly 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 Documentation and Community
|
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- apps/docs/content/components/dropdown/multiple-selection.ts (1 hunks)
- apps/docs/content/components/dropdown/single-selection.ts (1 hunks)
- apps/docs/content/docs/components/dropdown.mdx (2 hunks)
Files skipped from review due to trivial changes (1)
- apps/docs/content/docs/components/dropdown.mdx
Additional comments not posted (4)
apps/docs/content/components/dropdown/single-selection.ts (2)
39-76
: Great use of TypeScript for type safety!The
AppTs
component effectively uses TypeScript to enhance type safety and clarity. The use ofSelection
type forselectedKeys
ensures that the state is managed correctly. The component structure is clean and follows React best practices.
77-82
: Well-structured export object!Including both JavaScript and TypeScript versions in the
react
object is a good approach for providing comprehensive examples. This structure aids in documentation and helps users understand the differences between the two implementations.apps/docs/content/components/dropdown/multiple-selection.ts (2)
40-78
: Excellent integration of TypeScript for improved type safety!The
AppTs
component effectively uses TypeScript to enhance type safety and clarity. The use ofSelection
type forselectedKeys
ensures that the state is managed correctly. The component structure is clean and follows React best practices.
79-82
: Well-structured export object!Including both JavaScript and TypeScript versions in the
react
object is a good approach for providing comprehensive examples. This structure aids in documentation and helps users understand the differences between the two implementations.
Closes #3626
📝 Description
currently dropdown single and multiple selection only provide jsx. For those who are using typescript, those code will throw warning on onSelectionChange and they don't know how to fix it. Hence, add the TS examples as well.
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
New Features
Documentation