fix hoisting errors

This commit is contained in:
Samuel Newman
2025-10-08 17:09:22 +03:00
parent aac898d229
commit 46103b661e
2 changed files with 17 additions and 17 deletions
+7 -7
View File
@@ -41,12 +41,6 @@ export function Pager({
const scrollYs = useRef<Array<number | null>>([])
const anchorRef = useRef(null)
useImperativeHandle(ref, () => ({
setPage: (index: number) => {
onTabBarSelect(index)
},
}))
const onTabBarSelect = useCallback(
(index: number) => {
const scrollY = window.scrollY
@@ -80,12 +74,18 @@ export function Pager({
[selectedPage, setSelectedPage, onPageSelected],
)
useImperativeHandle(ref, () => ({
setPage: (index: number) => {
onTabBarSelect(index)
},
}))
return (
<View style={s.hContentRegion}>
{renderTabBar({
selectedPage,
tabBarAnchor: <View ref={anchorRef} />,
onSelect: e => onTabBarSelect(e),
onSelect: onTabBarSelect,
})}
{Children.map(children, (child, i) => (
<View