Skip to content

Commit 462647b

Browse files
committed
FocusItemsHelper --> useFocusItemsHelper
1 parent d79af43 commit 462647b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/tabController/TabBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {Constants} from '../../helpers';
1414
import {LogService} from '../../services';
1515
import FadedScrollView from './FadedScrollView';
1616

17-
import focusItemsHelper, {OffsetType} from '../../helpers/FocusItemHelper';
17+
import useFocusItemsHelper, {OffsetType} from '../../helpers/useFocusItemHelper';
1818

1919
const {Code, Value, interpolate, block, set} = Reanimated;
2020

@@ -200,7 +200,7 @@ const TabBar = (props: Props) => {
200200

201201
const itemsCount = useRef<number>(items ? _.size(items) : React.Children.count(children.current));
202202

203-
const {onItemLayout, itemsWidths, focusIndex} = focusItemsHelper({
203+
const {onItemLayout, itemsWidths, focusIndex} = useFocusItemsHelper({
204204
scrollViewRef: tabBar,
205205
itemsCount: itemsCount.current,
206206
selectedIndex,

src/helpers/FocusItemHelper.ts renamed to src/helpers/useFocusItemHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export type ResultProps = {
6565
focusIndex: (index: number, animated?: boolean) => void;
6666
};
6767

68-
const focusItemsHelper = (props: Props): ResultProps => {
68+
const useFocusItemsHelper = (props: Props): ResultProps => {
6969
const {
7070
scrollViewRef,
7171
itemsCount,
@@ -168,4 +168,4 @@ const focusItemsHelper = (props: Props): ResultProps => {
168168
};
169169
};
170170

171-
export default focusItemsHelper;
171+
export default useFocusItemsHelper;

0 commit comments

Comments
 (0)