You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to render my Custom Tab but im chaning the index its keep setting the each index in between and feels like flickering
like if I got 1 to 4
the state change like 1 --> 2 --> 3 --> 4
but I want only 4 and in android it swipes to each screen
I want to render my Custom Tab but im chaning the index its keep setting the each index in between and feels like flickering
like if I got 1 to 4
the state change like 1 --> 2 --> 3 --> 4
but I want only 4 and in android it swipes to each screen
`
const CustomTab: FC = ({ Header, tabs }) => {
const containerRef = useRef(null);
const { colors } = useTheme();
const [focusedIndex, setFocusedIndex] = useState(0);
const handleSetIndex = (newIndex: number) => {
containerRef.current?.setIndex(newIndex);
setFocusedIndex(newIndex);
};
return (
}<Tabs.Container
lazy
cancelLazyFadeIn
cancelTranslation
revealHeaderOnScroll={true}
renderHeader={() =>
ref={containerRef}
headerContainerStyle={styles.noOpacity}
renderTabBar={(props) => (
<TabBar
tabNames={props.tabNames}
focusedIndex={focusedIndex}
onSetIndex={(index) => handleSetIndex(index)}
/>
)}
containerStyle={{
backgroundColor: colors.background,
paddingVertical: 0,
}}
onIndexChange={(i) => {
setFocusedIndex(i);
}}
>
{tabs.map((item, index) => {
return (
<Tabs.Tab key={index} name={item.name}>
{item.component}
</Tabs.Tab>
);
})}
</Tabs.Container>
);
er.mp4
};`
The text was updated successfully, but these errors were encountered: