*Edit Please follow the tutorial first, see if you face the issues of scroll end drag is not giving the correct index before you implement my work around. & Thanks for this simple multi view tab component without using other library. For anyone that face the issues of onScrollEndDrag the content offset x decimal value is smaller then screen width decimal, making the newIndex not correct. here a work around: onScrollEndDrag={event => { const offsetX = event.nativeEvent.contentOffset.x; const index = Math.round(offsetX / windowWidth); if (horizontalScrollRefHeader?.current) { horizontalScrollRefHeader.current.scrollToIndex({ animated: true, index, viewPosition: 0.5, }); setCurTab(index); } }}
It helps a lot 👍🏻 want more content related react native
Sure 👍, thank you so much 😊
Its very helpful for me you are great sir.Also upload more videos related react-native
Sure 👍, thank you so much 😊
Good job bro
Thank you so much 😀
*Edit
Please follow the tutorial first, see if you face the issues of scroll end drag is not giving the correct index before you implement my work around.
& Thanks for this simple multi view tab component without using other library.
For anyone that face the issues of onScrollEndDrag the content offset x decimal value is smaller then screen width decimal, making the newIndex not correct.
here a work around:
onScrollEndDrag={event => {
const offsetX = event.nativeEvent.contentOffset.x;
const index = Math.round(offsetX / windowWidth);
if (horizontalScrollRefHeader?.current) {
horizontalScrollRefHeader.current.scrollToIndex({
animated: true,
index,
viewPosition: 0.5,
});
setCurTab(index);
}
}}
Thank you so much 🙏👌 🫡
It helps a lot for me
Good job bro :)
Thanks 😁
It helps a lot for me❤ 🎉
Sure 👍, thank you so much 😊
Hiiiii
This thing