-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[useTabs] Add explicit return type #36047
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f2cba7e
[useTabs] Add explicit return type
sai6855 2bba01a
lint
sai6855 daeb6e1
prop patch
sai6855 6554bc6
prop
sai6855 50ad3e1
removed description
sai6855 0baa398
prop
sai6855 62382cc
Merge branch 'master' into use-tabs-return-value
sai6855 55dc869
docs:api
sai6855 c8ea974
imports fix
sai6855 7774d78
Merge branch 'master' into use-tabs-return-value
ZeeshanTamboli 19ac5fd
use TabsContextValue interface
ZeeshanTamboli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
export interface UseTabsParameters { | ||
/** | ||
* The value of the currently selected `Tab`. | ||
* If you don't want any selected `Tab`, you can set this prop to `false`. | ||
*/ | ||
value?: string | number | false; | ||
/** | ||
* The default value. Use when the component is not controlled. | ||
*/ | ||
defaultValue?: string | number | false; | ||
/** | ||
* The component orientation (layout flow direction). | ||
* @default 'horizontal' | ||
*/ | ||
orientation?: 'horizontal' | 'vertical'; | ||
/** | ||
* The direction of the text. | ||
* @default 'ltr' | ||
*/ | ||
direction?: 'ltr' | 'rtl'; | ||
/** | ||
* Callback invoked when new value is being set. | ||
*/ | ||
onChange?: (event: React.SyntheticEvent, value: number | string | boolean) => void; | ||
/** | ||
* If `true` the selected tab changes on focus. Otherwise it only | ||
* changes on activation. | ||
*/ | ||
selectionFollowsFocus?: boolean; | ||
} | ||
|
||
export interface UseTabsReturnValue { | ||
tabsContextValue: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add a JSDocs description please. |
||
/** | ||
* Id used as a prefix for the current Tabs. | ||
*/ | ||
idPrefix: string | undefined; | ||
/** | ||
* The value of the currently selected `Tab`. | ||
* If you don't want any selected `Tab`, you can set this prop to `false`. | ||
*/ | ||
value: string | number | false; | ||
/** | ||
* Callback for setting new value. | ||
*/ | ||
onSelected: (e: React.SyntheticEvent, newValue: string | number | false) => void; | ||
/** | ||
* The component orientation (layout flow direction). | ||
*/ | ||
orientation?: 'horizontal' | 'vertical'; | ||
/** | ||
* The direction of the text. | ||
*/ | ||
direction: 'ltr' | 'rtl' | undefined; | ||
/** | ||
* If `true` the selected tab changes on focus. Otherwise it only | ||
* changes on activation. | ||
*/ | ||
selectionFollowsFocus: boolean | undefined; | ||
}; | ||
} |
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.
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.
Not sure how to extract descriptions from nested objects