Skip to content

Commit a4ce7c4

Browse files
authored
chore: update ts def (#443)
1 parent 7738731 commit a4ce7c4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"trailingComma": "all",
44
"printWidth": 100,
55
"proseWrap": "never",
6+
"arrowParens": "avoid",
67
"overrides": [
78
{
89
"files": ".prettierrc",

src/TabNavList/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref<HTMLDivElement>) {
168168

169169
useTouchMove(tabsWrapperRef, (offsetX, offsetY) => {
170170
function doMove(setState: React.Dispatch<React.SetStateAction<number>>, offset: number) {
171-
setState((value) => {
171+
setState(value => {
172172
const newValue = alignInRange(value + offset);
173173

174174
return newValue;
@@ -299,7 +299,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref<HTMLDivElement>) {
299299
renderWrapper={children}
300300
removeAriaLabel={locale?.removeAriaLabel}
301301
ref={getBtnRef(key)}
302-
onClick={(e) => {
302+
onClick={e => {
303303
onTabClick(key, e);
304304
}}
305305
onRemove={() => {
@@ -413,7 +413,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref<HTMLDivElement>) {
413413
// Should recalculate when rtl changed
414414
useEffect(() => {
415415
onListHolderResize();
416-
}, [rtl, tabBarGutter, activeKey, tabs.map((tab) => tab.key).join('_')]);
416+
}, [rtl, tabBarGutter, activeKey, tabs.map(tab => tab.key).join('_')]);
417417

418418
// ========================= Render ========================
419419
const hasDropdown = !!hiddenTabs.length;

src/interface.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { TabNavListProps } from './TabNavList';
12
import type { TabPaneProps } from './TabPanelList/TabPane';
23

34
export type TabSizeMap = Map<
@@ -38,9 +39,12 @@ type RenderTabBarProps = {
3839
extra: TabBarExtraContent;
3940
style: React.CSSProperties;
4041
panes: React.ReactNode;
41-
}
42+
};
4243

43-
export type RenderTabBar = (props: RenderTabBarProps, DefaultTabBar: React.ComponentType) => React.ReactElement;
44+
export type RenderTabBar = (
45+
props: RenderTabBarProps,
46+
DefaultTabBar: React.ComponentType<TabNavListProps>,
47+
) => React.ReactElement;
4448

4549
export interface TabsLocale {
4650
dropdownAriaLabel?: string;

0 commit comments

Comments
 (0)