-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE(web-react): Rename Tabs props and clean up its types …
…#DS-1096 Rename TabItem prop `forTab` to `forTabPane`. Rename TabPane prop `tabId` to `id`. See the Tabs: TabItem and TabPane Props section in the web-react package Migration Guide to version 2.
- Loading branch information
Showing
26 changed files
with
217 additions
and
200 deletions.
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
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
14 changes: 4 additions & 10 deletions
14
packages/web-react/src/components/Tabs/UncontrolledTabs.tsx
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 |
---|---|---|
@@ -1,18 +1,12 @@ | ||
import React from 'react'; | ||
import { ChildrenProps, TabId, TransferProps } from '../../types'; | ||
import { UncontrolledTabsProps } from '../../types'; | ||
import { TabsProvider } from './TabContext'; | ||
import { useTab } from './useTabs'; | ||
|
||
interface TabsProps extends ChildrenProps, TransferProps { | ||
defaultSelectedTab: TabId; | ||
// eslint-disable-next-line react/require-default-props | ||
onSelectionChange?: (tabId: TabId) => void; | ||
} | ||
const Tabs = ({ children, defaultSelectedTab, onSelectionChange }: UncontrolledTabsProps): JSX.Element => { | ||
const { selectedId, selectTab } = useTab(defaultSelectedTab); | ||
|
||
const Tabs = ({ children, defaultSelectedTab, onSelectionChange }: TabsProps): JSX.Element => { | ||
const { selectedTabId, selectTab } = useTab(defaultSelectedTab); | ||
|
||
return <TabsProvider value={{ selectedTabId, selectTab, onSelectionChange }}>{children}</TabsProvider>; | ||
return <TabsProvider value={{ selectedId, selectTab, onSelectionChange }}>{children}</TabsProvider>; | ||
}; | ||
|
||
export default Tabs; |
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
Oops, something went wrong.