hoaphantn7604 / react-native-curved-bottom-bar

A high performance, beautiful and fully customizable curved bottom navigation bar for React Native.
MIT License
476 stars 98 forks source link

Perfomance when wrap bottom bar with Stack.Navigator #56

Open ducpt-bili opened 1 year ago

ducpt-bili commented 1 year ago

The bottom tab is so lagging when i combine Curved Bottom Bar and Stack navigator. The layer is like this:

Thank you.

arun-saleth commented 1 year ago

Yes i am also facing issue while using nesting navigation.when clicking tab icons so much delay to navigate

hoaphantn7604 commented 1 year ago

hi @ducpt-bili , @arun-saleth , What steps can I follow to replicate the issue you are experiencing? Have you tried using React.memo and then wrapping the BottomBar?

arun-saleth commented 1 year ago

I will share my code here

<CurvedBottomBar.Navigator style={styles.bottomBar} screenOptions={{ headerShown: false }} strokeColor="#DDDDDD" circleWidth={60} strokeWidth={1} bgColor="white" shadowStyle={styles.shawdow} initialRouteName="Home" // width={isTablet ? width / 2.3 : width} borderTopLeftRight renderCircle={({ selectedTab, navigate }) => (

)} tabBar={RenderTabBar} > 700 ? JobstabletScreen : Jobscreen} position="LEFT" /> 700 ? TasktabletScreen : Taskscreen} position="RIGHT" /> const RenderTabBar = ({ routeName, selectedTab, navigate }) => { return ( navigate(routeName)} style={{ height: 50, alignItems: "center", }} > {_renderIcon(routeName, selectedTab)} ); }; const _renderIcon = (routeName, selectedTab) => { let icon = ""; switch (routeName) { case "Home": icon = routeName === selectedTab ? : break; case "Job": icon = routeName === selectedTab ? : break; case "Calendar": icon = routeName === selectedTab ? : break; case "Task": icon = routeName === selectedTab ? : break; } return ( {icon} {routeName} ); }; My nesting navigation structure: ------------------ Inside Drawernavigation I am using tab navigation ----------------------------------------- }>
arun-saleth commented 1 year ago

@hoaphantn7604 when I expect this? .too much lagging

arun-saleth commented 1 year ago

@hoaphantn7604 I tried memo.Its woking perfectly.Thank you for your Suggestions

jelyqs commented 1 year ago

Hi @arun-saleth

Can you share with me where to handle useMemo?

Sulaiman122 commented 1 year ago

@hoaphantn7604 @arun-saleth it's slow for me, I don't know why, tried useMemo didn't change maybe i wrote it wrong, could you explain how to use useMemo or if there is another solution to this issue please help

anhnguyen123 commented 7 months ago

CHÀO@ducpt-bili,@arun-saleth, Tôi có thể làm theo những bước nào để tái hiện vấn đề bạn đang gặp phải? Bạn đã thử sử dụng React.memo và sau đó gói BottomBar chưa?

Do you mean wrap usememo to cover the entire bottom bar?