Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slide Flickering in Android also the state changing every index #399

Open
Ritik5Prasad opened this issue Apr 29, 2024 · 0 comments
Open
Labels
question Further information is requested

Comments

@Ritik5Prasad
Copy link

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

};`

@Ritik5Prasad Ritik5Prasad added the question Further information is requested label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant